Author: nextgens
Date: 2006-04-14 15:07:57 +0000 (Fri, 14 Apr 2006)
New Revision: 8553

Modified:
   trunk/apps/installer/installclasspath/linux/update.sh
Log:
installer: new linux update script

Modified: trunk/apps/installer/installclasspath/linux/update.sh
===================================================================
--- trunk/apps/installer/installclasspath/linux/update.sh       2006-04-14 
14:06:50 UTC (rev 8552)
+++ trunk/apps/installer/installclasspath/linux/update.sh       2006-04-14 
15:07:57 UTC (rev 8553)
@@ -1,72 +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 -O freenet-cvs-snapshot.jar -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-cvs-snapshot.jar freenet-cvs-snapshot.jar 
freenet-r*-snapshot.jar
-       $DOWNLOADER2
-       mv $(cat freenet-cvs-snapshot.jar.url|cut -d\/ -f 5) 
freenet-cvs-snapshot.jar
-       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


Reply via email to