Author: nextgens
Date: 2006-04-15 07:57:53 +0000 (Sat, 15 Apr 2006)
New Revision: 8555

Modified:
   trunk/apps/installer/installclasspath/linux/update.sh
   trunk/apps/installer/installclasspath/windows/update.cmd
Log:
installer: new update scripts

Modified: trunk/apps/installer/installclasspath/linux/update.sh
===================================================================
--- trunk/apps/installer/installclasspath/linux/update.sh       2006-04-14 
18:54:46 UTC (rev 8554)
+++ trunk/apps/installer/installclasspath/linux/update.sh       2006-04-15 
07:57:53 UTC (rev 8555)
@@ -1,78 +1,78 @@
-#!/bin/bash
-WHEREAMI="$(pwd)"
-cd @path@
-echo "Updating freenet"
-
-if [[ "$1" != "debug" ]]
-then
-       THEMASK="-o /dev/null"
-fi
-
-if [[ "$(which wget)" == "" ]]
-then
-       WGET=0
-       DOWNLOADER="curl -q -f -L $THEMASK -O "
-       DOWNLOADER2="curl -q -f -L $THEMASK -O 
http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar";
-       DOWNLOADER3="curl -q -f -L $THEMASK -O "
-else
-       WGET=1
-       # see https://bugs.freenetproject.org/view.php?id=223
-       # we can't afford a valid non-selfsigned SSL certificate :/
-       if [[ $(wget --version | head -n1 | cut -d" " -f3 | cut -d"." -f2) -ge 
10 ]]
-       then
-           NOCERT="--no-check-certificate "
-       fi
-       DOWNLOADER="wget $THEMASK -N "
-       DOWNLOADER2="wget $THEMASK -N -i freenet-cvs-snapshot.jar.url"
-       DOWNLOADER3="wget $THEMASK -N -O update2.sh $NOCERT "
-fi
-
-rm -f freenet-cvs-snapshot.jar.url
-$DOWNLOADER 
http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar.url
-
-touch freenet-cvs-snapshot.jar.url.old freenet-cvs-snapshot.jar.url
-diff --brief freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.url.old
-if [[ $? -ne 0 ]]
-then
-       echo "Downloading freenet"
-       rm -f freenet-r*-snapshot.jar
-       $DOWNLOADER2
-       if [[ -s $(cat freenet-cvs-snapshot.jar.url | cut -d\/ -f 5) ]]
-       then
-           rm -f freenet-cvs-snapshot.jar
-           mv $(cat freenet-cvs-snapshot.jar.url | cut -d\/ -f 5) 
freenet-cvs-snapshot.jar
-       else
-           echo "Error downloading the new node: Please try again in 5 
minutes, mirrors may not be fully updated if an update has just been published."
-       fi
-       if [[ -s freenet-cvs-snapshot.jar ]]
-       then
-               mv freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.url.old
-               echo "Restarting freenet"
-               exec sh run.sh restart
-       else
-               echo "Error updating the node"
-               exit
-       fi
-else
-       echo "Your freenet node is up to date"
-fi
-
-
-$DOWNLOADER3 
https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/linux/update.sh
-touch update.sh update2.sh
-diff --brief update.sh update2.sh
-if [[ $? -ne 0 ]]
-then
-       LOCATION="$(pwd | sed -e 's/\//\\\//g')"
-       # we need to escape it, thanks to the_JinX for the hack
-       WHAT="@pa"
-       WHAT2="th@"
-       if [[ $WGET -eq 0 ]]
-       then
-               cp update.sh update2.sh
-       fi
-       cat update2.sh |sed "s/$WHAT$WHAT2/$LOCATION/" > update.sh
-       chmod +x update.sh
-fi
-
-cd $WHEREAMI
+#!/bin/bash
+WHEREAMI="$(pwd)"
+cd @path@
+echo "Updating freenet"
+
+if [[ "$1" != "debug" ]]
+then
+       THEMASK="-o /dev/null"
+fi
+
+if [[ "$(which wget)" == "" ]]
+then
+       WGET=0
+       DOWNLOADER="curl -q -f -L $THEMASK -O "
+       DOWNLOADER2="curl -q -f -L $THEMASK -O 
http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar";
+       DOWNLOADER3="curl -q -f -L $THEMASK -O "
+else
+       WGET=1
+       # see https://bugs.freenetproject.org/view.php?id=223
+       # we can't afford a valid non-selfsigned SSL certificate :/
+       if [[ $(wget --version | head -n1 | cut -d" " -f3 | cut -d"." -f2) -ge 
10 ]]
+       then
+           NOCERT="--no-check-certificate "
+       fi
+       DOWNLOADER="wget $THEMASK -N "
+       DOWNLOADER2="wget $THEMASK -N -i freenet-cvs-snapshot.jar.url"
+       DOWNLOADER3="wget $THEMASK -N -O update2.sh $NOCERT "
+fi
+
+rm -f freenet-cvs-snapshot.jar.url
+$DOWNLOADER 
http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar.url
+
+touch freenet-cvs-snapshot.jar.url.old freenet-cvs-snapshot.jar.url
+diff --brief freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.url.old
+if [[ $? -ne 0 ]]
+then
+       echo "Downloading freenet"
+       rm -f freenet-r*-snapshot.jar
+       $DOWNLOADER2
+       if [[ -s $(cat freenet-cvs-snapshot.jar.url | cut -d\/ -f 5) ]]
+       then
+           rm -f freenet-cvs-snapshot.jar
+           mv $(cat freenet-cvs-snapshot.jar.url | cut -d\/ -f 5) 
freenet-cvs-snapshot.jar
+       else
+           echo "Error downloading the new node: Please try again in 5 
minutes, mirrors may not be fully updated if an update has just been published."
+       fi
+       if [[ -s freenet-cvs-snapshot.jar ]]
+       then
+               mv freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.url.old
+               echo "Restarting freenet"
+               exec sh run.sh restart
+       else
+               echo "Error updating the node"
+               exit
+       fi
+else
+       echo "Your freenet node is up to date"
+fi
+
+
+$DOWNLOADER3 
https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/linux/update.sh
+touch update.sh update2.sh
+diff --brief update.sh update2.sh
+if [[ $? -ne 0 ]]
+then
+       LOCATION="$(pwd | sed -e 's/\//\\\//g')"
+       # we need to escape it, thanks to the_JinX for the hack
+       WHAT="@pa"
+       WHAT2="th@"
+       if [[ $WGET -eq 0 ]]
+       then
+               cp update.sh update2.sh
+       fi
+       cat update2.sh |sed "s/$WHAT$WHAT2/$LOCATION/" > update.sh
+       chmod +x update.sh
+fi
+
+cd $WHEREAMI

Modified: trunk/apps/installer/installclasspath/windows/update.cmd
===================================================================
--- trunk/apps/installer/installclasspath/windows/update.cmd    2006-04-14 
18:54:46 UTC (rev 8554)
+++ trunk/apps/installer/installclasspath/windows/update.cmd    2006-04-15 
07:57:53 UTC (rev 8555)
@@ -4,7 +4,7 @@
 ::if you modify this script in any way it will be detected as outdated and 
will be overwritten on the next run.
 ::To force a re-download of the latest Freenet .jar, simply delete 
freenet-cvs-snapshot.jar.url before running this script.
 echo -----
-echo - Freenet Windows update script 1.4 by Zero3Cool (zero3cool at 
zerosplayground.dk)
+echo - Freenet Windows update script 1.5 by Zero3Cool (zero3cool at 
zerosplayground.dk)
 echo - Thanks to search4answers, Michael Schierl and toad for help and 
feedback.
 echo - This script will automatically update your Freenet installation.
 echo - In case of an unrecoverable error, this script will pause.
@@ -35,7 +35,7 @@

 ::Check if updater has been updated
 fc update.cmd update.new.cmd > nul
-if errorlevel 0 goto updaterok
+if not errorlevel 1 goto updaterok

 ::It has! Run new version and end self
 echo - Updater updated, restarting update...
@@ -58,7 +58,7 @@

 ::Compare with current copy
 fc freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.new.url > nul
-if errorlevel 0 goto noupdate
+if not errorlevel 1 goto noupdate

 :updatefreenet
 echo - New version found, shutting down and updating Freenet...


Reply via email to