forked from vtsingaras/firmware-mod-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rehashes to the check for upgrade script
- Loading branch information
1 parent
33b2461
commit 871a75d
Showing
1 changed file
with
11 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |