Most recent edit on 2008-05-09 03:58:05 by MythBuster [Added support code for Mac OS users]
Additions:
For this script to work for MacOS X users, you will need to install textutils for sha1sum... if you are using fink, execute this command:
%%(fink)
sudo fink install textutils
Edited on 2007-05-13 12:24:53 by JeromeFlesch [bleh]
Additions:
echo "Sorry, can't contact the remote server"
Deletions:
echo "Probleme, impossible de contacter le serveur distant."
Edited on 2007-01-14 23:56:48 by FridiM
Additions:
if [ $# -gt 1 ]; then
}
if [ $1 = "-h" -o $1 = "--help" -o $1 = "-help" ]; then
_help
elif [ $1 = "stable" ]; then RELEASE="Thaw.jar";
Deletions:
if [ $1 = "stable" ]; then RELEASE="Thaw.jar";
Edited on 2007-01-14 23:49:25 by FridiM
Additions:
if test ! -x `which wget` -o ! -x `which sha1sum`; then
echo "You need wget and sha1sum command to perform this update."
if [ $# -eq 1 ]; then
if [ $1 = "stable" ]; then RELEASE="Thaw.jar";
elif [ $1 = "testing" ]; then
RELEASE="Thaw-testing.jar";
echo "testing update..."
RELEASE="Thaw.jar"
if ! wget "http://downloads.freenetproject.org/alpha/Thaw/$RELEASE.sha1∞" -O sha1.tmp 1>/dev/null 2>&1 ; then
echo "Probleme, impossible de contacter le serveur distant."
if test ! -e $RELEASE; then
touch $RELEASE
sha1_local=`sha1sum $RELEASE | awk '{print \$1}'`
if test ! -e Thaw.jar; then
touch Thaw.jar
sha1_local=`sha1sum Thaw.jar | awk '{print \$1}'`
Thaw update script
Deletions:
Thaw update script
Edited on 2006-12-01 19:37:46 by JeromeFlesch
Additions:
Thaw update script
thanks to fridim :)
Oldest known version of this page was edited on 2006-12-01 19:37:22 by JeromeFlesch []
Page view:
#!/bin/bash
echo "Checking for update..."
if ! wget http://downloads.freenetproject.org/alpha/Thaw/Thaw.jar.sha1 -O sha1.tmp 1>/dev/null 2>&1 ; then
echo "Probleme, impossible de contacter le serveur distant."
exit 1
fi
if test ! -e Thaw.jar; then
touch Thaw.jar
fi
sha1_local=`sha1sum Thaw.jar | awk '{print \$1}'`
sha1_remote=`cat sha1.tmp | awk '{print \$1}'`
rm sha1.tmp
echo "Current : $sha1_local"
echo "On server : $sha1_remote"
if test ! "$sha1_local" = "$sha1_remote"; then
echo "Update available. Updating..."
rm Thaw.jar
if ! wget http://downloads.freenetproject.org/alpha/Thaw/Thaw.jar 1>/dev/null 2>&1 ; then
echo "Unable to connect to server."
exit 1
fi
echo "Thaw updated."
else
echo "Thaw uptodate"
fi
exit 0