Skip to content

Commit

Permalink
rehashes to the check for upgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremycollake committed Apr 30, 2013
1 parent 33b2461 commit 871a75d
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions check_for_upgrade.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
#!/bin/sh
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# 20110224-1507-MCT - Needed quotes around a string compare.
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
echo " Checking for updates ..."
mkdir update_check
cd update_check
TMPNAME=`mktemp`
SYSNAME=`uname`
if [ `expr "$SYSNAME" : "Darwin"` = 6 ]; then
curl -O -s --connect-timeout 4 --retry 1 https://firmware-mod-kit.googlecode.com/git/firmware_mod_kit_version.txt
else
wget --quiet --timeout=4 --tries=1 https://firmware-mod-kit.googlecode.com/git/firmware_mod_kit_version.txt
fi
cd ..
if [ ! -f "update_check/firmware_mod_kit_version.txt" ]; then
echo " ! WARNING: Could not check for update. No connectivity or server down?"
rm -rf update_check
mkdir tmp
cd tmp
wget --quiet --timeout=4 --tries=1 https://firmware-mod-kit.googlecode.com/git/firmware_mod_kit_version.txt
mv firmware_mod_kit_version.txt "$TMPNAME"
cd .. && rm -rf tmp
if [ ! -f "$TMPNAME" ]; then
echo " ! WARNING: Could not check for update. No connectivity?"
exit 1
fi
NEW_VERSION=`cat update_check/firmware_mod_kit_version.txt`
CUR_VERSION=`cat firmware_mod_kit_version.txt`
NEW_VERSION=`cat $TMPNAME`
CUR_VERSION=`cat ./firmware_mod_kit_version.txt`
if [ "$NEW_VERSION" != "$CUR_VERSION" ]; then
echo " !!! There is a newer version available: $NEW_VERSION"
echo " You are currently using $CUR_VERSION"
else
echo " You have the latest version of this kit."
fi
rm -rf update_check
rm -rf "$TMPNAME"
exit 0

0 comments on commit 871a75d

Please sign in to comment.