IONAS - All in one NAS script

# Script via TheeMahn <theemahn@ultimateedition.info>

#

# This script preform multiple tasks to make the most

# out of your Seagate Goflex NAS.

#

# please ssh into your NAS as root and execute this

# script.



# TODO: add ionice, pyload

## Version control

AIONAS="1.7.0-3"

CURRENT=$PWD



## set colors so errors etc. stand out.



txtblk='\e[0;30m' # Black - Regular

txtred='\e[0;31m' # Red

txtgrn='\e[0;32m' # Green

txtylw='\e[0;33m' # Yellow

txtblu='\e[0;34m' # Blue

txtpur='\e[0;35m' # Purple

txtcyn='\e[0;36m' # Cyan

txtwht='\e[0;37m' # White

bldblk='\e[1;30m' # Black - Bold

bldred='\e[1;31m' # Red

bldgrn='\e[1;32m' # Green

bldylw='\e[1;33m' # Yellow

bldblu='\e[1;34m' # Blue

bldpur='\e[1;35m' # Purple

bldcyn='\e[1;36m' # Cyan

bldwht='\e[1;37m' # White

unkblk='\e[4;30m' # Black - Underline

undred='\e[4;31m' # Red

undgrn='\e[4;32m' # Green

undylw='\e[4;33m' # Yellow

undblu='\e[4;34m' # Blue

undpur='\e[4;35m' # Purple

undcyn='\e[4;36m' # Cyan

undwht='\e[4;37m' # White

bakblk='\e[40m'   # Black - Background

bakred='\e[41m'   # Red

badgrn='\e[42m'   # Green

bakylw='\e[43m'   # Yellow

bakblu='\e[44m'   # Blue

bakpur='\e[45m'   # Purple

bakcyn='\e[46m'   # Cyan

bakwht='\e[47m'   # White

txtrst='\e[0m'    # Text Reset



# Get Directory aionas was executed in.



CURRENT=$PWD

# variable setup



temp="/tmp"             ; # this is where temporary files are downloaded to

nzb_home="/home/nzbget" ; # this is where nzbget will setup it's files

nfs_kernel_check="2.6.22.18" ; # minimum version needed for NFS



# package locations

     SSHD_LOCATION="http://www.streetster.co.uk/dl/stora/sshd.tar.gz"

     IPKG_LOCATION="http://downloadue.info/NAS/Firmware/ipkg-opt_0.99.163-10_arm.ipk"

      NFS_LOCATION="http://downloadue.info/NAS/Firmware/nfs-utils_GFH_tar.gz"

NZBGETWEB_LOCATION="http://www.streetster.co.uk/dl/stora/nzbgetweb-1.4.zip"

  NZBGETD_LOCATION="http://www.streetster.co.uk/dl/stora/nzbgetd"

   RPCLIB_LOCATION="http://www.streetster.co.uk/dl/stora/xmlrpc-2.2.2.tar.gz"



######################################################

#### You should not need to edit below this line. ####

######################################################



# check that we are root before starting



if [ $(whoami) != "root" ] 

then

    echo ""

    echo -e "${bldred}Error: You must have root privileges to run this script."

    echo ""

    echo "Try again using 'sudo $0'."

    echo -e"${txtrst}"

    # die

    exit 1

fi



# clear the screen

clear



echo -e "${bldwht}#################################################################"

echo " Welcome to the TheeMahn's Goflex NAS all-in-one setup script... "

echo "#################################################################"



count=1



echo ""

echo -e "${bldgrn}What would you like to do?${txtwht}"

echo ""

echo -n "$count. Swap the ssh daemon? (y/n): "

read -e SSHD_SUBSTITUTION

count=`expr $count + 1`



echo -n "$count. Install Kernel NFS? (y/n): "

read -e KERNEL_NFS

count=`expr $count + 1`



echo -n "$count. Install the IPKG package manager? (y/n): "

read -e INSTALL_IPKG

count=`expr $count + 1`



echo -n "$count. Move /opt to the harddrive (recommended if non NTFS drive)? (y/n): "

read -e MOVE_OPT_TO_HDD

count=`expr $count + 1`



echo -n "$count. Remove Access Patrol (highly recommended)? (y/n): "

read -e DISABLE_ACCESS_PATROL

count=`expr $count + 1`



echo -n "$count. Setup the PATH variable (a must)? (y/n): "

read -e SET_PATH

count=`expr $count + 1`



echo -n "$count. Install NZBget? (y/n): "

read -e INSTALL_NZBGET

count=`expr $count + 1`



echo -n "$count. Install NZBget-server? (y/n): "

read -e INSTALL_NZBGETWEB

count=`expr $count + 1`



echo -n "$count. Install Mediatomb server? (y/n): "

read -e INSTALL_MEDIATOMB

count=`expr $count + 1`



echo -n "$count. Kill unecessary service cupsd printer daemon? (y/n): "

read -e KILL_CUPS

count=`expr $count + 1`



echo -n "$count. Install transmission torrent daemon and client? (y/n): "

read -e TRANSMISSION

count=`expr $count + 1`



echo -n "$count. Enable Secure FTP? (y/n): "

read -e SECURE_FTP

count=`expr $count + 1`



echo -n "$count. Install common tools (nano, bash etc) & codecs? (y/n): "

read -e COMMON_TOOLZ

count=`expr $count + 1`

echo ""



echo -n "$count. Install pyload?"

echo -e "${bldred}Note: Requires above option move to /opt/ to be selected"

echo "and the NAS drive to be formated in a linux based format"

echo -e "EXT3, EXT4, XFS etc.${txtwht} (y/n): "

read -e PYLOAD

count=`expr $count + 1`

echo ""

#### now we are ready to go! ####



## Setup PATH

if [ "$SET_PATH" = "y" ]

then

    # setup new path variable

    NEW_PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/sbin:/opt/sbin:/usr/sbin:/sbin"

	

    # set the environment

    echo "PATH=$NEW_PATH" > /etc/environment

    echo "PATH=$NEW_PATH" > /etc/profile

   	PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/sbin:/opt/sbin:/usr/sbin:/sbin"



    # export the path too

    export PATH=$NEW_PATH

echo -e "${bldgrn}Path has be set to:${bldwht}"

echo -e "$NEW_PATH${bldwht}"

#load path into current shell

. /etc/profile

fi



## SSHd Substitution



if [ "$SSHD_SUBSTITUTION" = "y" ]

then

    echo -e "${bldgrn}Replacing SSH Daemon...${txtwht}"



    # download

    wget -O $temp/sshd.tar.gz $SSHD_LOCATION  



    # check file exists

    if [ -s $temp/sshd.tar.gz ]

    then

        # extract

        tar -xzf $temp/sshd.tar.gz -C $temp/



        # backup original

        cp /usr/sbin/sshd /usr/sbin/sshd.original

        chmod -x /usr/sbin/sshd.original

   

        # replace and make executable

        mv $temp/sshd /usr/sbin/sshd

        chmod +x /usr/sbin/sshd

   

        # restart daemon

        /etc/init.d/sshd restart



        # clean-up

        rm $temp/sshd.tar.gz

    else

        echo ""

        echo -e "${bldred}Error: Unable to download SSHd.${txtrst}"

        echo ""

    fi

fi



## Install IPKG



if [ "$INSTALL_IPKG" = "y" ]

then

    echo -e "${bldgrn}Installing IPKG...${txtwht}"



    # download

    wget -O $temp/ipkg.ipk $IPKG_LOCATION



    # check file exists

    if [ -s $temp/ipkg.ipk ]

    then

        # extract

        tar -xzf $temp/ipkg.ipk -C $temp/

        tar -xzf $temp/data.tar.gz -C /



        # setup sources

        sed -i 's/# src/src/g' /opt/etc/ipkg.conf

	echo  'src seagateplug-stable http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable' >> /opt/etc/ipkg.conf

	echo  'src seagateplug-unstable http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable' >> /opt/etc/ipkg.conf

        /opt/bin/ipkg update



        # clean-up

        rm $temp/ipkg.ipk

        rm $temp/data.tar.gz

        rm $temp/control.tar.gz

        rm $temp/debian-binary



    else

        echo ""

        echo -e "${bldred}Error: Unable to download IPKG.${txtrst}"

        echo ""

    fi

fi



## Move /opt to HDD

if [ "$MOVE_OPT_TO_HDD" = "y" ]

then



#Implement check for filesystem type

if [[ `file -sL /dev/sda1 | grep "NTFS"` == "" ]]; then

    echo -e "${bldgrn}Moving /opt to HDD...${txtwht}"



    # copy everything

    mkdir -p /home/$USER/GoFlex\ Home\ Personal/.opt/

    cd /opt/

    cp -R * /home/$USER/GoFlex\ Home\ Personal/.opt/



    # rename old

    mv /opt /opt-old



    # Clean up

    rm -R /opt-old



    # symbolic link to hdd

    ln -s /home/$USER/GoFlex\ Home\ Personal/.opt/ /opt

#FILE="/opt/"

#echo -e "${bldgrn}Scaning for executables in $FILE Stage 1.${txtwht}"

#find $FILE -name "DEBIAN" -prune -o -type f -exec sh -c 'test "$(head -c 2 "$1")" = "#!"' sh {} \; -print -exec chmod 755 {} \;

#No header, no problem

#find $FILE -name "*.sh" -exec chmod 755 {} \;

#find $FILE -name "*.py" -exec chmod 755 {} \;

#Nonstandard? spaces ( " etc.  sed 's/\([ "(){}$#\&~'"'"']\)/\\\1/g'

#echo "${bldgrn}Scaning for executables in $FILE Stage 2.${txtwht}"

#find $FILE -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -exec chmod 755 {} \;

cd $CURRENT

fi

else

echo -e "${bldred}Error: Your NAS drive is formatted in NTFS which does not support permissions for /opt useage."

fi



## Setup Kernel NFS



if [ "$KERNEL_NFS" = "y" ]

then

    echo -e "${bldgrn}Setting up Kernel NFS...${txtwht}"



    if [ `uname -r` = "$nfs_kernel_check" ]

    then



        # download

        wget -O $temp/nfs.tar.gz $NFS_LOCATION

    

        # check file exists

        if [ -s $temp/nfs.tar.gz ]

        then

            # extract

            tar -xzf $temp/nfs.tar.gz -C /



            # load/check module

            /sbin/depmod -a

            /sbin/modprobe nfsd

            /sbin/lsmod | grep nfsd



	    # NFS Lock

		cd /etc/init.d/

		wget http://downloadue.info/NAS/Firmware/nfslock

		chmod 755 /etc/init.d/nfslock



            # add default share to Server's IP (detect it)

	    SERVERIP=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')

            echo "/home/0common "$SERVERIP"/255.255.255.0(rw,sync,no_root_squash,no_subtree_check)" > /etc/exports



            # remove v4 support

            mv /etc/sysconfig/nfs /etc/sysconfig/nfs.original

            cat /etc/sysconfig/nfs.original | sed 's/^#RPCNFSDARGS="-N\ 4"/RPCNFSDARGS="-N\ 4"/' > /etc/sysconfig/nfs



            # start daemons

            /etc/init.d/portmap start

            /etc/init.d/nfs start

    	    service nfslock start



            # start at boot

            /sbin/chkconfig --add portmap

            /sbin/chkconfig --level 235 portmap on

            /sbin/chkconfig --add nfs

            /sbin/chkconfig --level 235 nfs on

    	    service nfslock start

            # check it looks ok

            /sbin/exportfs -v



            # clean-up

            rm $temp/nfs.tar.gz

	echo -e "${bldwht}To mount the NFS share on the client ie Ultimate Edition, Ubuntu etc:${bldgrn}"

	echo "sudo mkdir -p /media/NASNFS"

	echo "sudo mount "$SERVERIP":/home/0common /media/NASNFS"

	echo ""

	echo -e "${bldwht}To mount on boot add the following to your /etc/fstab/:${bldgrn}"

	echo $SERVERIP":/home/0common /media/NASNFS nfs rsize=8192,wsize=8192,timeo=14,intr"

	echo -e "${txtwht}"

        else

            echo ""

            echo -e "${bldred}Error: Unable to download NFS.${txtrst}"

            echo ""

        fi

    else

        # wrong kernel version

        echo -e "${bldred}Error: Wrong Kernel, please upgrade to $nfs_kernel_check.${txtrst}"

    fi

fi



## Setup NZBget

if [ "$INSTALL_NZBGET" = "y" ]

then

    echo -e "${bldgrn}Installing NZBget...${txtwht}"



    if [ -e /opt/bin/ipkg ]

    then



        /opt/bin/ipkg install nzbget

        /opt/bin/ipkg install unrar



        # set home directory, umask to 0000 and parcheck to 1.



        cat /opt/share/doc/nzbget/nzbget.conf.example | sed -e "s#~/download#$nzb_home#"\

                                                            -e "s#UMask=1000#UMask=0000#"\

                                                            -e "s#DirectWrite=no#DirectWrite=yes#"\

                                                            -e "s#PostProcess=#PostProcess=$nzb_home/postprocess.sh#"\

                                                            -e "s#ParCheck=no#ParCheck=yes#" > /usr/etc/nzbget.conf

        # copy example post-process script

        cp /opt/share/doc/nzbget/postprocess-example.sh $nzb_home/postprocess.sh



        # setup nzbget daemon

        wget -O $temp/nzbgetd $NZBGETD_LOCATION

        mv $temp/nzbgetd /etc/init.d/nzbgetd

        chmod +x /etc/init.d/nzbgetd



        # start at boot

        /sbin/chkconfig --add nzbgetd

        /sbin/chkconfig --level 235 nzbgetd on



        # start daemon

        /etc/init.d/nzbgetd start



    else

        echo -e "${bldred}Error: IPKG not found."

        echo ""

        echo -e "Please install IPKG in order to download additional packages.${txtrst}"

    fi

fi



## Setup NZBget-web



if [ "$INSTALL_NZBGETWEB" = "y" ]

then

    echo -e "${bldgrn}Setting up NZBGET-web...${txtwht}"



    # download 

    wget -O $temp/nzbgetweb.zip $NZBGETWEB_LOCATION

    wget -O $temp/xmlrpc.tar.gz $RPCLIB_LOCATION



    # grab unzip if we dont have it already

    if [ ! -e /opt/bin/unzip ]

    then

        /opt/bin/ipkg install unzip

    fi

       

    # we can share the http server by placing files in /var/www/

    /opt/bin/unzip -d /var/www $temp/nzbgetweb.zip  



    # we also need the PHP RPC library

    tar -xzf $temp/xmlrpc.tar.gz -C $temp/

    cp -r $temp/xmlrpc-2.2.2/lib /var/www/nzbgetweb/lib



    # set permissions

    chgrp -R www /var/www/nzbgetweb/

    chmod -R 755 /var/www/nzbgetweb/

    chown -R apache /var/www/nzbgetweb/



    # setup the alias

    cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.original

    echo 'Alias /nzbgetweb/ "/var/www/nzbgetweb/"' >> /etc/httpd/conf/httpd.conf



    # restart httpd daemon

    /sbin/service httpd reload



    # clean-up

    rm $temp/nzbgetweb.zip

    rm $temp/xmlrpc.tar.gz

    rm -r $temp/xmlrpc-2.2.2



fi



## Disable Access Patrol service



if [ "$DISABLE_ACCESS_PATROL" = "y" ]

then

    echo -e "${bldgrn}Disabling Access Patrol...${txtwht}"



    # stop service

    /etc/init.d/access-patrol stop

    echo ""

    echo ""



    # remove from boot

    /sbin/chkconfig --levels 2345 access-patrol off



    # remove executable flag

    chmod a-x /usr/sbin/access-patrol

fi



## Setup Mediatomb

if [ "$INSTALL_MEDIATOMB" = "y" ]

then

	echo -e "${bldgrn}Installing mediatomb media server...${txtwht}"

	/opt/bin/ipkg install mediatomb

	echo "MT_ENABLE=true" > /opt/etc/default/mediatomb

	/opt/etc/init.d/S90mediatomb start

	cd /etc/init.d

# Set eth0 as default port

sed -i 's/MT_OPTIONS=""/MT_OPTIONS="-e eth0"/g' /opt/etc/mediatomb.conf

# Set decoding options etc.

sed -i 's/<name>MediaTomb<\/name>/<name>'$USER's NAS<\/name>/g' /opt/etc/mediatomb/config.xml

sed -i 's/<protocolInfo extend="no".*/<protocolInfo extend="yes" samsung-hack="yes"\/>/g' /opt/etc/mediatomb/config.xml

sed -i 's/<add header=".*/<add header="transferMode.dlna.org: Streaming"\/><add header="contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"\/>/g' /opt/etc/mediatomb/config.xml

sed -i 's/<\/scripting>/<\/scripting><autoscan use-inotify="auto"><directory location="\/home\/'$USER'\/GoFlex\ Home\ Personal\/" mode="timed" interval="3600" level="full" recursive="yes" hidden-files="no"\/><\/autoscan>/g' /opt/etc/mediatomb/config.xml

sed -i 's/<!-- <map from="avi" to="video/avi"\/> -->/<map from="avi" to="video/avi"\/>/g' /opt/etc/mediatomb/config.xml



	ln -s /opt/etc/init.d/S90mediatomb

	/sbin/chkconfig --add S90mediatomb

	/sbin/chkconfig --levels 2345 S90mediatomb on

	/opt/etc/init.d/S90mediatomb



fi

## Setup Kill Unneeded

if [ "$KILL_CUPS" = "y" ]

then

	echo -e "${bldgrn}Killing cups and preventing from startup...${txtwht}"

	chmod -x /usr/sbin/cupsd

	killall cupsd

fi



## Transmission?

if [ "$TRANSMISSION" = "y" ]

then

echo -e "${bldgrn}Installing Transmission torrent client and daemon...${txtwht}"

PKGURL="http://downloadue.info/NAS/Firmware/transmission-1_92_ARM_Stora_tar"  

BINPATH="/usr/local/bin"

WEBPATH="/usr/share/transmission"

SCRIPTPATH="/etc/init.d"

SETTINGSPATH="/home/$USER/.config/transmission-daemon"

DLPATH="/home/$USER/GoFlex Home Personal/Downloads"

#WTPATH="$DLPATH/Torrents"

JSONDLPATH="\\\\\/home\\\\\/.config\\\\\/transmission-daemon\\\\\/Downloads"

JSONWTPATH="\\\\\/home\\\\\/.config\\\\\/transmission-daemon\\\\\/myTorrentFolder"

#ipkg install transmission

temp=$(sed -i "s/^.*download-dir.*/    \"download-dir\": \"$DLPATH\",/g" $SETTINGSPATH/settings.json 2>&1)

sed -i "s/supportsTransmission=0/supportsTransmission=1/g" /etc/features.conf

cd /tmp/

wget http://downloadue.info/NAS/Firmware/transmission-1_92_ARM_Stora_tar

tar xfv transmission-1_92_ARM_Stora_tar

cd transmission

mv transmission-daemon /usr/local/bin

cp -R web /usr/share/transmission/

cd init.d

mv transmission-daemon /etc/init.d/

sed -i 's/DAEMON_USER="user"/DAEMON_USER="'$USER'"/g' /etc/init.d/transmission-daemon

#sed -i 's/TRANSMISSION_HOME=\/home\/.config\/transmission-daemon/TRANSMISSION_HOME=\/home\/'$USER'\/.config\/transmission-daemon//g' /etc/init.d/transmission-daemon

#sed -i 's/.*TRANSMISSION_HOME=.*/TRANSMISSION_HOME=\/home\/'$USER'\/.config\/transmission-daemon//g' /etc/init.d/transmission-daemon



sed -i 's/TRANSMISSION_HOME=.*/TRANSMISSION_HOME=\/home\/'$USER'\/.config\/transmission-daemon\//g' /etc/init.d/transmission-daemon

mkdir -p /home/$USER/.config/transmission-daemon

chmod 777 /home/$USER/.config/transmission-daemon/

/etc/init.d/transmission-daemon start

ps -ef |grep transmission-daemon

/etc/init.d/transmission-daemon stop



#set blocklist

cd /home/$USER/.config/transmission-daemon/blocklists/

wget http://downloadue.info/NAS/Firmware/blocklist.bin

sed -i 's/"blocklist-enabled": false,/"blocklist-enabled": true,/g' /home/$USER/.config/transmission-daemon/settings.json



#Modify settings.json

sed -i 's/"rpc-whitelist": "127.0.0.1"/"rpc-whitelist": "*.*.*.*"/g' /home/$USER/.config/transmission-daemon/settings.json

sed -i 's/"rpc-whitelist-enabled": true/"rpc-whitelist-enabled": false/g' /home/$USER/.config/transmission-daemon/settings.json

#sed -i 's/"rpc-enabled": true/"rpc-enabled": false/g' /home/$USER/.config/transmission-daemon/settings.json

sed -i 's/"speed-limit-up": 100/"speed-limit-up": 0/g' /home/$USER/.config/transmission-daemon/settings.json

sed -i 's/"speed-limit-up-enabled": false/"speed-limit-up-enabled": true/g' /home/$USER/.config/transmission-daemon/settings.json

sed -i 's/"download-dir": ".*/"download-dir": "\/home\/'$USER'\/GoFlex Home Personal\/Downloads\/",/g' /home/$USER/.config/transmission-daemon/settings.json

sed -i 's/"incomplete-dir": ".*/"incomplete-dir": "\/home\/'$USER'\/GoFlex Home Personal\/Incomplete\/",/g' /home/$USER/.config/transmission-daemon/settings.json

sed -i 's/"incomplete-dir-enabled": false,/"incomplete-dir-enabled": true,/g' /home/$USER/.config/transmission-daemon/settings.json

mkdir -p /home/$USER/GoFlex\ Home\ Personal/Torrentz/

mkdir -p /home/$USER/GoFlex\ Home\ Personal/Downloads/

mkdir -p /home/$USER/GoFlex\ Home\ Personal/Incomplete/

chmod -R 777 /home/$USER/GoFlex\ Home\ Personal/

sed -i 's/}//g' /home/$USER/.config/transmission-daemon/settings.json

sed -i 's/"upload-slots-per-torrent": 14/"upload-slots-per-torrent": 14,/g' /home/$USER/.config/transmission-daemon/settings.json

#Delete if old setting exists before appending to file

sed -i 's/"watch-dir.*//g' /home/$USER/.config/transmission-daemon/settings.json



echo '    "watch-dir":"/home/'$USER'/GoFlex Home Personal/Torrentz/",' >> /home/$USER/.config/transmission-daemon/settings.json

echo '    "watch-dir-enabled": true

}' >> /home/$USER/.config/transmission-daemon/settings.json



#autostart daemon

/etc/init.d/transmission-daemon start

/sbin/chkconfig --add transmission-daemon

/sbin/chkconfig --levels 2345 transmission-daemon on



#Cleanup

cd $CURRENT

rm transmission-1_92_ARM_Stora_tar

rm -R transmission

fi



#Secure FTP?

if [ "$SECURE_FTP" = "y" ]

then

echo -e "${bldgrn}Installing Secure FTP...${txtwht}"

sed -i 's/ssl_enable=NO/ssl_enable=YES/g' /etc/vsftpd/vsftpd.conf

sed -i 's/#ftpd_banner=.*/ftpd_banner=Welcome to '$USER's secure FTP service./g' /etc/vsftpd/vsftpd.conf

/etc/init.d/vsftpd restart

fi



#Common Tools?

if [ "$COMMON_TOOLZ" = "y" ]

then

echo -e "${bldgrn}Installing common tools...${txtwht}"

ipkg install nano bash faad2 ffmpeg flac freetype fribidi liba52 libdvbpsi libdvdnav libdvdread libid3tag libmad libmpcdec libmpeg2 libogg libpng libshout libupnp libvorbis libxml2 ncursesw speex avahi x264

fi



#Pyload?

if [ "$PYLOAD" = "y" ]

then

echo -e "${bldred}Pyload subfunction has not been written yet. Please stay tuned.${txtrst}"

#echo -e "${bldgrn}Installing Pyload...${txtwht}"

#add check to see if user has moved opt...



#/opt/bin/ipkg install python py25-crypto py25-curl libcurl py25-openssl py25-django tesseract-ocr unzip sqlite wget-ssl py25-pil unrar ossp-js

#cd /opt/

#wget http://get.pyload.org/get/src/

#/opt/bin/unzip pyload-src*.zip

#rm pyload-src-*.zip

#cd /opt/pyload/

#python pyLoadCore.py --changedir --configdir=/opt/pyload/.pyload

#python pyLoadCore.py -s

fi



#WEB Interface

wget http://downloadue.info/NAS/Firmware/html.tar.gz

tar xfv html.tar.gz

cd html

chmod 777 -R *

cp -R * /var/www/html/html/

#Reboot?

echo -n "$count. Reboot NAS drive? (y/n): "

read -e REBOOT_NAS

if [ "$REBOOT_NAS" = "y" ]

then

	/sbin/reboot

fi



#/sbin/reboot

#EOF
