I wrote a simple script to check if the deluge daemon is running and if not to restart it:
#!/bin/bash if [[ $(pidof deluged | wc -1) -eq 0 ]]; then deluged fi
I added it to scheduled job on cron to make it run every 5 minutes...everything works fine;
if I kill the deluge daemon (
deluged), my script restarts it correctly.
My problem is that:
I'm using deluge to download torrents, but sometimes it loses the connection with the localhost (127.0.0.1) and periodically I have to check if it still running. How can I improve the above code to automatically reconnect to the host?