Created
July 13, 2014 13:01
-
-
Save lanhuai/8934767fd2804429a51c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
logger_general() | |
{ | |
logger -s -p local0.notice -t geek_script $1 | |
} | |
logger_general "###########Geek script Started###########" | |
if [ $1 = "web-gui" ] ;then | |
logger_general "###########Geek script started from web-gui###########" | |
logger_general "Sleeping for 30 secs to give time for router boot" | |
sleep 30 | |
logger_general "Done sleeping for 30" | |
else | |
logger_general "###########Geek script started Manually###########" | |
fi | |
logger_general "###########Geek script inits environments###########" | |
if [ -f /mnt/sda_part1/dd-wrt/optware.enable ]; then | |
mount -o bind /mnt/sda_part1/dd-wrt/etc /etc | |
logger_general "Mounted /etc was mounted on ext3 with return code of "`echo $?`"." | |
mount -o bind /mnt/sda_part1/dd-wrt/root /tmp/root | |
logger_general "Mounted /tmp/root was mounted on ext3 with return code of "`echo $?`"." | |
mount -o bind /mnt/sda_part1/dd-wrt/opt /opt | |
logger_general "Mounted /opt was mounted on ext3 with return code of "`echo $?`"." | |
else | |
exit | |
fi | |
if [ -d /opt/usr ]; then | |
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/opt/usr/local/lib:/lib:/usr/lib' | |
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin' | |
else | |
exit | |
fi | |
if [ -d /mnt/sda_part1/dd-wrt ]; then | |
logger_general "activating swap" | |
swapon /mnt/sda_part1/dd-wrt/swap.page | |
export TRANSMISSION_WEB_HOME=/mnt/sda_part1/dd-wrt/opt/usr/share/transmission/web | |
ln -s /mnt/sda_part1 /mnt/sda1 | |
/opt/usr/bin/transmission-daemon -g /mnt/sda1/transmission | |
logger_general "transmission executed" | |
else | |
exit | |
fi | |
logger_general "###########Geek script starter Done###########" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment