Sunday, August 24, 2014

Raspberry Pi SeedBox

Installed Deluge 1.3.6 as per this post:

http://www.onepitwopi.com/raspberry-pi/installing-deluge-1-3-6-on-a-raspberry-pi/

Find External Hard Drive:

  •  dmesg | grep sd
  • [    4.487833] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/232 GiB)

Delete existing partitions with cfdisk 
  • cfdisk /dev/sda
and create a single primary partition. Then format:
  • mkfs.ext4 /dev/sda1
Mount it and setup automount:
  1. mkdir /media/usbhdd
  2. mount /dev/sda1 /media/usbhdd/
  3. echo "/dev/sda1       /media/usbhdd   ext4    defaults     0       0" >>/etc/fstab
Move /var/log to external HDD

  1.  /etc/init.d/rsyslog stop
  2. mv log /media/usbhdd/
  3. ln -s /media/usbhdd/log
  4.  /etc/init.d/rsyslog start
Script to update Deluge Interface IP (/etc/network/if-up.d):

#! /bin/sh
/etc/init.d/deluge-daemon stop
oldIP=`cat /etc/network/eth0.ip`
newIP=$(ip -f inet -o addr show eth0|cut -d\  -f 7 | cut -d/ -f 1)
logger "DELUGE Updating Deluge IP Address, $oldIP -> $newIP"
sed -i -e 's/listen_interface": "'$oldIP'"/listen_interface": "'$newIP'"/g'  /root/.config/deluge/core.conf
if [ $? = 0 ]; then
    echo $newIP >/etc/network/eth0.ip
    logger "DELUGE IP BINDING SUCCESS"
    /etc/init.d/deluge-daemon start
else
    logger "DELUGE IP BINDING FAILUE"
fi
Setup folder for Deluge stuff:
  1. mkdir /media/usbhdd/media
  2. ln -s /media/usbhdd/media/
Install FlexGet

  1. apt-get install python-pip
  2. pip install flexget