Code: Select all
#!/bin/bash
if [[ $(pidof deluged | wc -1) -eq 0 ]]; then
deluged
fi
My problem is that one:
I'm using deluge to download torrents, but sometimes it lost 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?
Thanks!