Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Original code by Dennis Simpson
- # Modified by Kyle Warwick-Mathieu
- echo "Checking if script is up to date, please wait"
- cd /root/ipbx-installer || exit
- git pull
- cd /tmp || exit
- wget http://incrediblepbx.com/incrediblepbx13-12.2-centos.tar.gz
- tar zxvf incrediblepbx*
- diff /root/ipbx-installer/IncrediblePBX13-12R.sh /tmp/IncrediblePBX13-12R.sh >& /dev/null
- if [ "$?" != "0" -a -s /tmp/IncrediblePBX13-12R.sh ]; then # If the exit code is not 0 (in other words if the file is different)
- cat /tmp/IncrediblePBX13-12R.sh > /root/ipbx-installer/IncrediblePBX13-12R.sh
- chmod +x /root/ipbx-installer/IncrediblePBX13-12R.sh
- cd /root/ipbx-installer/ || exit
- git add IncrediblePBX13-12R.sh
- git commit -m "Automated update"
- git push -f
- rm -rf /tmp/*
- exit
- else
- echo "Nothing to do!"
- rm /tmp/IncrediblePBX13-12R.sh # If no updates are available, simply remove the file
- rm -rf /tmp/*
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement