# 1. Create the bash script sudo tee /usr/local/bin/kuma-push-agent.sh > /dev/null << 'EOF' #!/bin/bash PUSH_URL="https://uptime.twe.tech/api/push/*******Change_the_Key_Here******?status=up&msg=OK" while true; do # curl the URL silently, timeout after 10 seconds if network drops curl -s -m 10 "$PUSH_URL" > /dev/null 2>&1 sleep 20 done EOF # 2. Make the script executable sudo chmod +x /usr/local/bin/kuma-push-agent.sh # 3. Create the systemd service file sudo tee /etc/systemd/system/kuma-push-agent.service > /dev/null << 'EOF' [Unit] Description=Uptime Kuma Push Agent After=network-online.target Wants=network-online.target [Service] Type=simple ExecStart=/usr/local/bin/kuma-push-agent.sh Restart=always RestartSec=10 User=root [Install] WantedBy=multi-user.target EOF # 4. Reload systemd, enable, and start the service sudo systemctl daemon-reload sudo systemctl enable kuma-push-agent.service sudo systemctl start kuma-push-agent.service # 5. Confirm success echo -e "\n\033[32mSuccess! Push Agent is running. Current status:\033[0m" sudo systemctl status kuma-push-agent.service --no-pager | grep Active