This commit is contained in:
sebseb7
2025-12-25 02:34:28 +01:00
parent a1793d0998
commit acbf168218

View File

@@ -181,3 +181,43 @@ echo -e " ${YELLOW}curl https://bashupload.com -F=@dist/tapo-countdown-pi3_pi4_
echo "" echo ""
echo "Then on Pi, download and run:" echo "Then on Pi, download and run:"
echo -e " ${YELLOW}curl -sSL https://bashupload.com/XXXXX -o tapo-agent && chmod +x tapo-agent${NC}" echo -e " ${YELLOW}curl -sSL https://bashupload.com/XXXXX -o tapo-agent && chmod +x tapo-agent${NC}"
echo ""
echo -e "${BLUE}=========================================="
echo "Installing as User Service (no sudo needed)"
echo -e "==========================================${NC}"
echo ""
echo "1. Setup binary and config:"
echo -e " ${YELLOW}chmod +x ~/tapo-agent${NC}"
echo -e " ${YELLOW}mkdir -p ~/.config/tapo${NC}"
echo -e " ${YELLOW}cp /path/to/config.toml ~/.config/tapo/config.toml${NC}"
echo ""
echo "2. Create service file:"
echo -e " ${YELLOW}mkdir -p ~/.config/systemd/user${NC}"
echo -e " ${YELLOW}cat > ~/.config/systemd/user/tapo-agent.service << 'EOF'"
echo "[Unit]"
echo "Description=Tapo Smart Plug Agent"
echo "After=network-online.target"
echo ""
echo "[Service]"
echo "Type=simple"
echo "ExecStart=%h/tapo-agent --config %h/.config/tapo/config.toml"
echo "Restart=always"
echo "RestartSec=10"
echo ""
echo "[Install]"
echo "WantedBy=default.target"
echo -e "EOF${NC}"
echo ""
echo "3. Enable and start service:"
echo -e " ${YELLOW}systemctl --user daemon-reload${NC}"
echo -e " ${YELLOW}systemctl --user enable tapo-agent${NC}"
echo -e " ${YELLOW}systemctl --user start tapo-agent${NC}"
echo ""
echo "4. Enable linger (service runs at boot, before login):"
echo -e " ${YELLOW}loginctl enable-linger \$USER${NC}"
echo ""
echo "5. Manage service:"
echo -e " ${YELLOW}systemctl --user status tapo-agent${NC} # Check status"
echo -e " ${YELLOW}systemctl --user restart tapo-agent${NC} # Restart"
echo -e " ${YELLOW}journalctl --user -u tapo-agent -f${NC} # View logs"