Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Note: I didn't create this, just keeping it here for a reference

Credit: http://wiki.freepbx.org/display/PPS/FreePBX-Distro-10.13.66

jlg89

error=? = STOP ON ERROR

error=0 = Keep going for ever!

mkdir /root/upgradescripts
cat << 'EOL'>upgrade.sh
#!/bin/bash
ugdir=/root/upgradescripts
if [ ! -d $ugdir ]
then
 mkdir $ugdir
fi
version=`cat /etc/schmooze/pbx-version`
base=`echo $version | cut -f1 -d'-'`
build=`echo $version | cut -f2 -d'-'`
echo ""
echo ----------------------------------------
echo Current FreePBX version is $version
echo Checking for updates...
echo ----------------------------------------
echo ""
error=0
while [ $error = 0 ]
do
 build=`expr $build + 1`
 wget --no-check-certificate http://upgrades.freepbxdistro.org/stable/$base/upgrade-$base-$build.sh -O $ugdir/upgrade-$base-$build.sh
 error=0
 if [ $error = 0 ]
 then
  chmod +x $ugdir/upgrade-$base-$build.sh
  $ugdir/upgrade-$base-$build.sh
 fi
done
echo ""
echo ----------------------------------------
echo Finished.
echo ----------------------------------------
echo ""
EOL
chmod +x upgrade.sh
./upgrade.sh
  • No labels