]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/rootfiles/core/38/update.sh
Started core41.
[people/pmueller/ipfire-2.x.git] / config / rootfiles / core / 38 / update.sh
index 59a718c7b9e13b020f11624169b5c88b7d4a8725..dc643fe56acc785a2385787ebf15086283c52d58 100644 (file)
 . /opt/pakfire/lib/functions.sh
 /usr/local/bin/backupctrl exclude >/dev/null 2>&1
 #
+OLDVERSION=`grep "version = " /opt/pakfire/etc/pakfire.conf | cut -d'"' -f2`
+#
+# Test if we running on xen
+#
+uname -r | grep "ipfire-xen";
+if [ ${?} = 0 ]; then
+       #Xen Kernel is active
+       NEWVERSION="2.7-xen"
+else
+       #Normal Kernel
+       NEWVERSION="2.7"
+fi
+#
 KVER="2.6.32.15"
 ROOT=`grep "root=" /boot/grub/grub.conf | cut -d"=" -f2 | cut -d" " -f1 | tail -n 1`
 MOUNT=`grep "kernel" /boot/grub/grub.conf | tail -n 1`
@@ -48,6 +61,9 @@ echo boot >> /opt/pakfire/tmp/ROOTFILES
 echo etc/sysconfig/lm_sensors >> /opt/pakfire/tmp/ROOTFILES
 echo usr/lib/ipsec >> /opt/pakfire/tmp/ROOTFILES
 echo usr/libexec/ipsec >> /opt/pakfire/tmp/ROOTFILES
+# exclude squid cache from backup
+sed -i -e "s|^var/log/cache|#var/log/cache|g" /opt/pakfire/tmp/ROOTFILES
+# Backup the files
 tar cjvf /var/ipfire/backup/core-upgrade_$KVER.tar.bz2 \
     -C / -T /opt/pakfire/tmp/ROOTFILES --exclude='#*' > /dev/null 2>&1
 
@@ -57,6 +73,7 @@ tar cjvf /var/ipfire/backup/core-upgrade_$KVER.tar.bz2 \
 /etc/init.d/collectd stop
 /etc/init.d/squid stop
 /etc/init.d/ipsec stop
+/etc/init.d/snort stop
 
 echo
 echo Update Kernel to $KVER ...
@@ -76,7 +93,16 @@ rm -rf /lib/modules/2.6.27.31-ipfire-xen
 #
 rm -rf /usr/lib/ipsec
 rm -rf /usr/libexec/ipsec
-
+#
+# old snort libs and rules ...
+#
+rm -rf /usr/lib/snort_*
+rm -rf /etc/snort
+#
+# mISDN Files that was moved to sbin
+#
+rm -rf /usr/bin/misdn_rename
+rm -rf /usr/bin/misdn_cleanl2
 #
 # Backup grub.conf
 #
@@ -93,9 +119,8 @@ echo Unpack the updated files ...
 tar xvf /opt/pakfire/tmp/files --preserve --numeric-owner -C / \
        --no-overwrite-dir
 #
-# Start Sevices
+# Start sysklogd
 /etc/init.d/sysklogd start
-/etc/init.d/squid start
 #
 # Modify grub.conf
 #
@@ -220,8 +245,33 @@ echo "cryptodev" >> /etc/sysconfig/modules
 echo "" >> /etc/sysconfig/modules
 echo "# End /etc/sysconfig/modules" >> /etc/sysconfig/modules
 chmod 644 /etc/sysconfig/modules
+# Change version of Pakfire.conf
+#
+sed -i "s|$OLDVERSION|$NEWVERSION|g" /opt/pakfire/etc/pakfire.conf
+#
+# After pakfire has ended run it again and update the lists and do upgrade
+#
+echo '#!/bin/bash'                                        >  /tmp/pak_update
+echo 'while [ "$(ps -A | grep " update.sh")" != "" ]; do' >> /tmp/pak_update
+echo '    sleep 1'                                        >> /tmp/pak_update
+echo 'done'                                               >> /tmp/pak_update
+echo 'while [ "$(ps -A | grep " pakfire")" != "" ]; do'   >> /tmp/pak_update
+echo '    sleep 1'                                        >> /tmp/pak_update
+echo 'done'                                               >> /tmp/pak_update
+echo '/opt/pakfire/pakfire update -y --force'             >> /tmp/pak_update
+echo '/opt/pakfire/pakfire upgrade -y'                    >> /tmp/pak_update
+echo '/opt/pakfire/pakfire upgrade -y'                    >> /tmp/pak_update
+echo '/opt/pakfire/pakfire upgrade -y'                    >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t core-upgrade-38 "Upgrade finished. If you use a customized grub.cfg"' >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t core-upgrade-38 "Check it before reboot !!!"' >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t core-upgrade-38 " *** Please reboot... *** "' >> /tmp/pak_update
+#
+chmod +x /tmp/pak_update
+/tmp/pak_update &
+#
+# Start squid
+/etc/init.d/squid start
 #
-# This core-update need a reboot
-/usr/bin/logger -p syslog.emerg -t core-upgrade-38 "Upgrade finished. If you use a customized grub.cfg"
-/usr/bin/logger -p syslog.emerg -t core-upgrade-38 "Check it before reboot !!!"
-/usr/bin/logger -p syslog.emerg -t core-upgrade-38 " *** Please reboot... *** "
+echo
+echo Please wait until pakfire has ended...
+echo