#
-# check if we the backup file already exist
-if [ -e /var/ipfire/backup/core-upgrade_$KVER.tar.bz2 ]; then
- echo Moving backup to backup-old ...
- mv -f /var/ipfire/backup/core-upgrade_$KVER.tar.bz2 \
- /var/ipfire/backup/core-upgrade_$KVER-old.tar.bz2
-fi
+# erase old backups to prefent disk-full on small installations
+rm -f /var/ipfire/backup/core-upgrade_*.tar.bz2
+
+#
+# backup
echo First we made a backup of all files that was inside of the
echo update archive. This may take a while ...
# Add some files that are not in the package to backup
rm -rf /boot/config-*
rm -rf /boot/ipfirerd-*
rm -rf /boot/vmlinuz-*
-rm -rf /lib/modules/*-ipfire
+rm -rf /lib/modules/*
#
# Backup grub.conf
#
/etc/init.d/snort stop
/etc/init.d/squid stop
/etc/init.d/ipsec stop
-
+/etc/init.d/dhcp stop
#
# Unpack the updated files
#
#
# Start services
#
+/etc/init.d/dhcp start
/etc/init.d/squid start
/etc/init.d/snort start
if [ `grep "ENABLED=on" /var/ipfire/vpn/settings` ]; then
/etc/init.d/ipsec start
fi
+
#
# Modify grub.conf
#
#
rm -rf /etc/sysconfig/lm_sensors
+# Ensure that all data was written...
+sync
+sync
+sync
+
# Reboot message to console
/usr/bin/logger -p syslog.emerg -t core-upgrade-51 "Upgrade finished. If you use a customized grub.cfg"
/usr/bin/logger -p syslog.emerg -t core-upgrade-51 "Check it before reboot !!!"
/usr/bin/logger -p syslog.emerg -t core-upgrade-51 " *** Please reboot... *** "
+# This update need a reboot.
+touch /var/run/need_reboot
#
#Finish
/etc/init.d/fireinfo start
sendprofile
+
+# Ensure that all data was written...
+sync
+sync
+sync
+
+#
#Don't report the exitcode last command
exit 0