dgzyk / phpvirtualbox

Automatically exported from code.google.com/p/phpvirtualbox
Other
0 stars 0 forks source link

Automatically update phpvirtualbox #573

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Since you guys went through the effort of making the LATEST.txt, I thought I'd 
provide this little script in the event that you wanted to bundle it, to 
provide an easy way for people to get the latest version.

#!/bin/bash
CURDIR=`pwd`
BASE="/home/vbox"
cd $BASE
if [ -e LATEST.txt ]; then
        mv LATEST.txt PREVIOUS.txt
else
        echo "LATEST.txt isn't present!"
        exit
fi
wget -q http://phpvirtualbox.googlecode.com/files/LATEST.txt
diff LATEST.txt PREVIOUS.txt
if [ $? == 0 ]; then
        echo "PHPVirtualBox is at the current version."
        exit
fi
cat LATEST.txt | xargs wget -q
cp -r www www.$(date +'%Y-%m-%d')
NEWFILE=`cat LATEST.txt | cut -f 5 -d '/'`
NEWDIR=`echo $NEWFILE | sed s/.zip//`
rm -rf $NEWDIR
unzip $NEWFILE
cp -r $NEWDIR/* www/
rm -rf $NEWDIR
cd $CURDIR
echo "Updated to $NEWDIR"

Original issue reported on code.google.com by aequi...@gmail.com on 28 Aug 2012 at 5:13

GoogleCodeExporter commented 8 years ago
Filed. Thank you.

Original comment by imooreya...@gmail.com on 4 Sep 2012 at 1:58