Files
bpfire/updates/1.4.11/setup

48 lines
1.8 KiB
Bash

#!/bin/bash
UPGRADEVERSION=1.4.11
PREVIOUSVERSION="1.4."$((`echo $UPGRADEVERSION | /usr/bin/cut -f3 -d '.'`-1))
echo "This is the $UPGRADEVERSION update patch for IPCop $PREVIOUSVERSION installing."
CURRENTVERSION=`perl -e "require '/var/ipcop/general-functions.pl';print \\$General::version;"`
if [ "$CURRENTVERSION" != "$PREVIOUSVERSION" ]; then
echo "You are not running IPCop v$PREVIOUSVERSION for this patch to install."
echo "Aborting installation."
exit -1
fi
# general-functions might not be overwrited by patch...
/bin/sed -i -e "s+= '1.4.*$+= '$UPGRADEVERSION';+" /var/ipcop/general-functions.pl
/bin/tar -zxpf patch.tar.gz -C /
# Backup have changed a little. Sets are located under Apache to facilitate
# their exportation. Unencrypted backups do not exists any more
find /var/ipcop/backup/sets/* -type d -exec mv {} /home/httpd/html/backup \;
# delete gz
find /home/httpd/html/backup -iname *gz -exec rm {} \;
#bug sf #1369531
sed -i -e 's/port 800/port __PROXY_PORT__/' /var/ipcop/proxy/acl
# patch rc.sysinit to include Slovak
/bin/sed -i -e 's/-o "$LANGUAGE" = "pl" ]/-o "$LANGUAGE" = "pl" -o "$LANGUAGE" = "sk" ]/' /etc/rc.d/rc.sysinit
# move randfile out of this dir, cause it annoys openswann
[ -e /var/ipcop/ca/.rnd ] && mv -f /var/ipcop/ca/.rnd /var/tmp/.rnd
# idem for private key cakey.pem
mkdir /var/ipcop/private
chown nobody:nobody /var/ipcop/private
[ -e /var/ipcop/ca/cakey.pem ] && mv -f /var/ipcop/ca/cakey.pem /var/ipcop/private/cakey.pem
#create variable missing
settings=/var/ipcop/vpn/settings
grep -q "VPN_DELAYED_START" $settings || echo "VPN_DELAYED_START=0">>$settings
#build cachelang file after all "lang/*.pl" updates
perl -e "require '/var/ipcop/lang.pl'; &Lang::BuildCacheLang"
killall mingetty #redisplay correct version
echo "end of $UPGRADEVERSION update"