mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-24 09:52:58 +02:00
44 lines
1.2 KiB
Bash
44 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
UPGRADEVERSION="1.4.3"
|
|
PREVIOUSVERSION="1.4.2"
|
|
echo "This is the $UPGRADEVERSION update patch for IPCop $PREVIOUSVERSION installing."
|
|
|
|
CURRENTVERSION=`cat /etc/issue | awk '{ print $2 }' | sed -e 's/v//'`
|
|
|
|
if [ "$CURRENTVERSION" != "$PREVIOUSVERSION" ]; then
|
|
echo "You are not running IPCop v$PREVIOUSVERSION for this patch to install."
|
|
echo "Aborting installation."
|
|
exit -1
|
|
fi
|
|
|
|
# Make some space first
|
|
/sbin/tune2fs -m 0 /dev/harddisk1
|
|
/sbin/tune2fs -m 1 /dev/harddisk4
|
|
/bin/rm -rf /var/patches/patch-*.tar.gz.gpg
|
|
/bin/rm -rf /etc/eagle-usb/dsp
|
|
|
|
/bin/tar -zxpf patch.tar.gz -C /
|
|
|
|
# update linker cache
|
|
/bin/rm -rf /lib/libz.so.1.2.1
|
|
/bin/rm -rf /usr/lib/libpng.so.3.1.2.7
|
|
/sbin/ldconfig
|
|
|
|
# Change tar.gz to tgz.gpg in language files.
|
|
# Completes fix for SF Bug 1077494
|
|
for file in /var/ipcop/langs/*.pl
|
|
do
|
|
sed -i -e '/to install an update/s/.tar.gz/.tgz.gpg/' $file
|
|
done
|
|
|
|
touch /var/ipcop/ddns/settings
|
|
chown 99:99 /var/ipcop/ddns/settings
|
|
|
|
# Fix file permissions of updated files
|
|
chown 99:99 /var/ipcop/modem/defaults
|
|
|
|
#this is in general v1.4.4 and we want v1.4.3 be displayed
|
|
/bin/sed -i -e "s+= '1.4.*$+= '$UPGRADEVERSION';+" /var/ipcop/header.pl
|
|
echo "IPCop v1.4.3 - The Bad Packets Stop Here" > /etc/issue
|