To automatically mount a harddrive partition on a OpenWrt enabled router with USB, insert this into /etc/init.d/usbmount on your router:

#!/bin/sh /etc/rc.common
START=80
STOP=40
start()
{
	echo -n "Enabling swap:  "
	swapon /dev/scsi/host0/bus0/target0/lun0/part1
	echo -n "Testing USB Partition:  "
        e2fsck -p /dev/scsi/host0/bus0/target0/lun0/part2 &
        sleep 5
        echo -n "Mounting USB drive: "
        mount -t ext3 -o noatime /dev/scsi/host0/bus0/target0/lun0/part2 /mnt
        echo "Done."
}
stop()
{
        echo -n "Umounting USB drive:  "
        sync
        sync
		swapoff /dev/scsi/host0/bus0/target0/lun0/part1
        umount /dev/scsi/host0/bus0/target0/lun0/part2
        echo "Done."
}
restart()
{
        stop
        start
}

Of course you need to adjust the script to fit your harddrives partition layout. Next, run this on your router:

cd /etc/init.d; chmod +x transmission; ./transmission enable

Related posts:

Tags: , ,

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.