How it works? First you need to set DISK_NAME variable to your actual usb disk name. Then you run Deluge using this script. It asks you if you really like to start the program without disk connected. It should work on Mint and Ubuntu, on others it might need changing mountpoint.
Code: Select all
#!/bin/bash
DISK_NAME='disk_name'
if [[ $(mount | grep "/media/$USER/$DISK_NAME") != '' ]]
then
nohup /usr/bin/deluge-gtk %U >/dev/null 2>&1 &
else
zenity \
--warning \
--text="<span font=\"12\">Device: $DISK_NAME is not available. Starting Deluge will cause torrent re-check afterwards.</span>\n" \
--title="Deluge" \
--ok-label="Run anyway" --width=500 --height=100 \
--extra-button "Cancel"
if [[ $? -eq 0 ]]
then
nohup /usr/bin/deluge-gtk %U >/dev/null 2>&1 &
fi
fi