######################################################################## #!/bin/bash # # auto_tbd_upgrade_1.06 2009/01/17 - # # # # thebridge upgrade to version 1.06 # # # # This script uses your existing tbd.conf file, it should exist in the # # /home/EchoIRLP/custom directory, for the upgrade. # # # # This script will download the latest version 'thebridge-1.06.tgz' # # from the W2YMM website # # and delete the existing EchoIRLP tbd version # # # # This script is for latest version of EchoIRLP # # upgrade to thebridge-1.06 # #This is a hacked version of KE4TTE's old script # ######################################################################## # Must be run as root if [ `/usr/bin/whoami` != "root" ] ; then echo "This program must be run as user root!" exit 1 fi # Sets the install directory (/home/irlp required) ID=/home/EchoIRLP CUSTOM=$ID/custom SRC=/usr/src TBD=thebridge-1.06.tgz TBDCNV=tbdcnv-0.03.tgz TBD_HOME="/home/EchoIRLP/tbd" # removes older versions of the tbd and tbdcnv cd $SRC rm -f $SRC/thebridge* >/dev/null 2>&1 rm -rfd $SRC/thebridge* >/dev/null 2>&1 rm -f $SRC/tbdcnv* >/dev/null 2>&1 rm -rfd $SRC/tbdcnv* >/dev/null 2>&1 # intro echo "EchoIRLP auto_tbd_upgrade_1.06 10/11/2008 W2YMM" echo "Note: TBD (TheBridge) is required for direct EchoLink connectivity." echo "Without TBD, Your EchoIRLP system will NOT work." echo "Select Y and press Enter... " TBD_YN="" while [ ! "$TBD_YN" = "Y" ] && [ ! "$TBD_YN" = "y" ] && [ ! "$TBD_YN" = "N" ] && [ ! "$TBD_YN" = "n" ]; do echo -n "Ready to upgrade TBD to version 1.06? (Y) " ; read TBD_YN done clear sleep 1 echo "Okay Cool, here we go.... " sleep 3 service tbd stop killall tbd >/dev/null 2>&1 sleep 2 # check for tbd tar if [ "$TBD_YN" = "Y" ] || [ "$TBD_YN" = "y" ] ; then # if yes then go if ! (grep "$1" $SRC/thebridge* >/dev/null 2>&1) ; then TBD_OK="N" echo " The TheBridge tar file was not found in "$SRC echo -n "Press ENTER to download thebridge-1.06.tgz : " ; read cd "$SRC" wget http://www.w2ymm.net/irlp/scripts/thebridge-1.06.tgz clear else TBD_OK="Y" fi # check for tbdcnv tar if ! (grep "$1" $SRC/tbdcnv* >/dev/null 2>&1) ; then echo " The tbdcnv* tar file was not found in "$SRC TBDCNV_OK="N" echo -n "Press ENTER to download tbdcnv-0.03.tgz : " ; read cd "$SRC" wget http://www.w2ymm.net/irlp/scripts/tbdcnv-0.03.tgz else TBDCNV_OK="Y" fi fi clear ####################################### # install tbdcnv tarball # ####################################### echo "Ready to install tbdcnv-0.03... " echo -n " Press any key to continue... " ; read clear sleep 1 rm -f $TBD_HOME/tbdcnv >/dev/null 2>&1 echo "Begin tbdcnv install... " sleep 1 cd "$SRC" TBDCNV_FULL_NAME=`ls tbdcnv*` echo "TBDCNV_FULL_NAME="$TBDCNV_FULL_NAME tar -xzvf "$TBDCNV_FULL_NAME" TBD_CNV_DIR=`ls -dxX tbdcnv* | cut -d' ' -f1` echo "$TBDCNV_FULL_NAME" echo "$TBD_CNV_DIR" cd "$SRC"/"$TBD_CNV_DIR" ./configure make make install mv /usr/local/bin/tbdcnv $TBD_HOME ln -s $TBD_HOME/tbdcnv /usr/local/bin/tbdcnv cd $ID rm -rf "$SRC"/"$TBD_CNV_DIR" rm -f $SRC/tbdcnv* >/dev/null 2>&1 clear ####################################### # install thebridge tarball # ####################################### echo "Ready to install thebridge-1.06... " echo -n "Press any key to continue... " ; read clear sleep 1 rm -f $TBD_HOME/tbdcmd >/dev/null 2>&1 rm -f $TBD_HOME/tbd >/dev/null 2>&1 echo "Begin thebridge install... " sleep 1 cd "$SRC" TBD_FULL_NAME=`ls thebridge*` echo "unpacking $TBD_FULL_NAME" tar -zxvf "$SRC"/"$TBD_FULL_NAME" TBD_INIT_DIR=`ls -dxX thebridge* | cut -f1` echo "TBD_INIT_DIR = $TBD_INIT_DIR" cd "$TBD_INIT_DIR" ./configure make cd RedHat ./install mv /usr/local/bin/tbdcmd $TBD_HOME mv /usr/local/libexec/tbd $TBD_HOME rm -f /usr/sbin/tbd ln -s $TBD_HOME/tbdcmd /usr/local/bin/tbdcmd ln -s $TBD_HOME/tbd /usr/sbin/tbd cd $ID rm -f /usr/local/etc/tbd.conf ln -s $ID/custom/tbd.conf /usr/local/etc/tbd.conf rm -rf "$SRC"/"$TBD_INIT_DIR" rm -f $SRC/thebridge* >/dev/null 2>&1 clear echo "Finished thebridge upgrade to version 1.06... " echo "Don't forget to add the extra lines at the end of tbd.conf file." echo -n "Press any key to continue... " ; read clear sleep 1 echo "Bada BING Bada BOOM, That's it, your finished... " echo -n "Press any key to continue... " ; read sleep 1 service tbd restart exit