Placing scripts, crontab, cleanup.
So now we need to place our handiwork and do a little hacking.
In Terminal (ssh session):
Code: Select all
cp deluged_added.sh /home/*USER*/.config/deluge/
cp deluged_execute.sh /home/*USER*/.config/deluge/
cp getlabels.py /home/*USER*/.config/deluge/
sudo cp deluged_startup.sh /etc/xbmc/live.d/
#scripts are placed, now some editing:
Code: Select all
sudo gedit /home/*USER*/.config/deluge/auth /etc/crontab
in AUTH: You will see this:
Code: Select all
localclient:5a-andalongstringofnumbershere63e:10
add:
#make sure to change that to something else!!!!

save and close auth.
In crontab add the following line:
Code: Select all
0 * * * * root /etc/xbmc/live.d/deluged_startup.sh
save and close crontab
#This will run your deluge daemon startup script every hour. I know it looks like you're running this as root, but if you set your username in the script, it will change user to you to run the daemon. It will check to see if you are running the daemon already(as you), and if not start it back up. Now since the cron command happens on startup BEFORE the mount command, not seeing a debug log in your log folder ISN'T a bad thing. That's normal. If Deluged crashes, when that script is called by cron, it will then have the access to the directory and you will see a debug log appear. No news is good news!
Btw, to check if the crontab entry is working(give it an hour or 2):
wait for reboot, and ssh back in again.
check deluge daemon:
Now
BACK TO DELUGE!
#If you want, you can still use your xhost'ed gtk to run, but since we added ourselves to the auth file, if you install just deluge on your remote/client computer, you can run it that way. Option "A".(less network and resource baggage), else option "B"
OPTION A: If you choose to run the GTK on your remote/client computer, open it up, go into OPTIONS->Interface->Classic Mode: UNCHECK!
Close options, and you should see another icon next to the options that looks like a network icon, click that.
In the "Connection Manager" you should see something like 127.0.0.1 or localhost. Click the ADD button.
HOSTNAME: your HTPC's IP address.
USERNAME: whatever you put in the "auth" file
PASSWORD: whatever you put in the "auth" file
PORT: default or whatever you chose earlier.
Click ADD.
if everything is running smoothly at this point, you should see a new host in your connection manager with a nice checkmark if the GTK sees the daemon
AND IF THE AUTH INFO IS CORRECT!!!!!*I really can't stress that enough*
Click "Connect", and go to "
NEXT STEP:"
OPTION B: So you're using xhost'ed gtk. tidy, but limits your abilities later.
in Connection Manager, open options [+] and check all 3 checkboxes. Since you are xhosting the session, localhost is which session you want, but you're limited to one connection.
Click "Connect", and go to "
NEXT STEP:"
NEXT STEP:
Open Options:
-->Execute:
Add Command: EVENT: Choose Torrent Added, in the space provided place
Code: Select all
/home/*USER/.config/deluge/deluged_added.sh
CLICK "
+ADD"
Add Command: EVENT: Choose Torrent Complete, in the space provided place
Code: Select all
/home/*USER/.config/deluge/deluged_execute.sh
CLICK "
+ADD"
CLICK APPLY, THEN
OK
Choose File-> Quit and Shutdown Daemon
in terminal:
Reconnect and make sure the execute options stuck.
CLEANUP:
In Terminal (ssh session)
Code: Select all
cd ~
mkdir /home/*user*/.config/userscripts
mv *.sh /home/*user*/.config/userscripts
NEXT: XBMC