Author: nextgens
Date: 2006-11-19 12:45:16 +0000 (Sun, 19 Nov 2006)
New Revision: 11006
Modified:
trunk/apps/installer/installclasspath/linux/update.sh
Log:
resolves #890: update.sh should be sh compliant now
Modified: trunk/apps/installer/installclasspath/linux/update.sh
===================================================================
--- trunk/apps/installer/installclasspath/linux/update.sh 2006-11-19
12:34:55 UTC (rev 11005)
+++ trunk/apps/installer/installclasspath/linux/update.sh 2006-11-19
12:45:16 UTC (rev 11006)
@@ -1,12 +1,12 @@
-#!/bin/bash
-WHEREAMI="$(pwd)"
+#!/bin/sh
+WHEREAMI="`pwd`"
echo "Updating freenet"
# Attempt to use the auto-fetcher code, which will check the sha1sums.
-if [[ "$#" -gt 0 ]]
+if test "$#" -gt 0
then
- if [[ "$1" == "testing" ]]
+ if test "$1" == "testing"
then
RELEASE="testing"
echo "WARNING! you're downloading an UNSTABLE snapshot version
of freenet."
@@ -19,12 +19,12 @@
# 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 ]]
+if test `wget --version | head -n1 | cut -d" " -f3 | cut -d"." -f2` -ge 10
then
NOCERT="--no-check-certificate "
fi
-if [[ ! -x "$(which wget)" ]]
+if test ! -x "`which wget`"
then
WGET=0
DOWNLOADER="curl --insecure -q -f -L -O "
@@ -33,24 +33,24 @@
DOWNLOADER="wget -o /dev/null -N "
fi
-if [[ ! -s sha1test.jar ]]
+if test ! -s sha1test.jar
then
for x in 1 2 3 4 5
do
echo Downloading sha1test.jar utility jar which will download
the actual update.
- if [[ $WGET -eq 1 ]]
+ if test $WGET -eq 1
then
$DOWNLOADER $NOCERT
http://get.freenetproject.org/sha1test.jar
else
$DOWNLOADER http://get.freenetproject.org/sha1test.jar
fi
- if [[ -s sha1test.jar ]]
+ if test -s sha1test.jar
then
break
fi
done
- if [[ ! -s sha1test.jar ]]
+ if test ! -s sha1test.jar
then
echo Could not download Sha1Test. The servers may be offline?
exit
@@ -76,12 +76,12 @@
exit
fi
-if [[ -f freenet-stable-latest.jar ]]
+if test -f freenet-stable-latest.jar
then
cp freenet-stable-latest.jar freenet-stable-latest.jar.old
fi
-if [[ -f freenet-ext.jar ]]
+if test -f freenet-ext.jar
then
cp freenet-ext.jar freenet-ext.jar.old
fi
@@ -107,20 +107,19 @@
cat wrapper.conf | sed 's/freenet-cvs-snapshot/freenet/g' | sed
's/freenet-stable-latest/freenet/g' | sed 's/freenet.jar.new/freenet.jar/g' >
wrapper2.conf
mv wrapper2.conf wrapper.conf
-if [[ ! -x "$(which cmp)" ]]
+if test ! -x "`which cmp`"
then
- if [[ ! -x "$(which md5sum)" ]]
+ if test ! -x "`which md5sum`"
then
echo No cmp or md5sum utility detected
echo Restarting the node as we cannot tell whether we need to.
./run.sh restart
else
- echo hmmm
- if [[ "$(md5sum freenet-stable-latest.jar)" != "$(md5sum
freenet-stable-latest.jar.old)" ]]
+ if test "`md5sum freenet-stable-latest.jar`" != "`md5sum
freenet-stable-latest.jar.old`"
then
echo Restarting node because freenet-stable-latest.jar
updated.
./run.sh restart
- elif [[ "$(md5sum freenet-ext.jar)" != "$(md5sum
freenet-ext.jar.old)" ]]
+ elif test "`md5sum freenet-ext.jar`" != "`md5sum
freenet-ext.jar.old`"
then
echo Restarting node because freenet-ext.jar updated.
./run.sh restart