summaryrefslogtreecommitdiffstats
path: root/etc/rc.firmware
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-10-03 21:57:32 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-10-03 21:57:32 +0000
commit2b61eeb1975e3104e148666c1d2b7e6ecc0a6f54 (patch)
tree677b316839034dc9a3b14c76dcc545330642c38f /etc/rc.firmware
parent6d80ad3ae60711ee95622580e37380080ef1c360 (diff)
downloadpfsense-2b61eeb1975e3104e148666c1d2b7e6ecc0a6f54.zip
pfsense-2b61eeb1975e3104e148666c1d2b7e6ecc0a6f54.tar.gz
if the update firmware unpacks /tmp/no_upgrade_reboot_required then do not reboot after update.
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-xetc/rc.firmware38
1 files changed, 26 insertions, 12 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 859fdc6..fd00dff 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -13,7 +13,7 @@ exec 3>&2 2>>/tmp/firmware_update.log
export ACTION=$1
export IMG=$2
-if [ $# -eq 3 ]; then
+if [ $# -eq 3 ]; then
export CUSTOMIMG=$3
fi
@@ -52,7 +52,7 @@ binary_update() {
remove_chflags
cd /tmp/patches
for i in `/usr/bin/tar tvzf $TGZ | egrep -v "(^d|_md5)" | nawk '{print $9;}'`;
- do
+ do
FILE=`basename ${i}`
echo "Working on ${i}"
# Untar patch file and md5 files
@@ -97,7 +97,7 @@ upgrade)
sleep 5
backup_chflags
remove_chflags
-
+
exec </dev/console >/dev/console 2>/dev/console
echo
@@ -131,7 +131,14 @@ upgrade)
sleep 5
echo "Done."
- sh /etc/rc.reboot
+ # If the archive has unpacked a file called
+ # /tmp/no_upgrade_reboot_required then do
+ # not reboot after upgrade.
+ if [ -f /tmp/no_upgrade_reboot_required ]; then
+ rm /tmp/no_upgrade_reboot_required
+ else
+ sh /etc/rc.reboot
+ fi
;;
pfSenseupgrade)
# wait 5 seconds before beginning
@@ -151,13 +158,13 @@ pfSenseupgrade)
echo "Firmware upgrade in progress..." | logger -p daemon.info -i -t Upgrade
# backup config
- /bin/mkdir -p /tmp/configbak
+ /bin/mkdir -p /tmp/configbak
cp -p /conf/* /tmp/configbak 2>/dev/null
# mount /cf
/etc/rc.conf_mount_rw
/sbin/mount -w -o noatime /cf 2>/dev/null
/sbin/mount -w -o noatime / 2>/dev/null
-
+
# tar explode image onto hd
echo "Installing $IMG." | logger -p daemon.info -i -t Upgrade
cd / && /usr/bin/tar xzUPf $IMG | logger -p daemon.info -i -t Upgrade
@@ -165,10 +172,10 @@ pfSenseupgrade)
echo "Image installed $IMG." | logger -p daemon.info -i -t Upgrade
# process custom image if its passed
- if [ $# -eq 3 ]; then
+ if [ $# -eq 3 ]; then
if [ -f $CUSTOMIMG ]; then
echo "Custom image $CUSTOMIMG found." | logger -p daemon.info -i -t Upgrade
- echo "Custom image ($CUSTOMIMG) found."
+ echo "Custom image ($CUSTOMIMG) found."
PWD_DIR=`pwd`
cd / && /usr/bin/tar xzPUf $CUSTOMIMG | logger -p daemon.info -i -t Upgrade
cd $PWD_DIR
@@ -184,7 +191,7 @@ pfSenseupgrade)
ln -s /var/etc/hosts /etc/hosts
restore_chflags
-
+
rm -f /var/run/firmware.lock
/bin/sync
@@ -202,10 +209,17 @@ pfSenseupgrade)
/sbin/mount -r / 2>/dev/null
if [ -e /etc/init_bootloader.sh ]; then
sh /etc/init_bootloader.sh
- fi
+ fi
/bin/sync
echo "Done." | logger -p daemon.info -i -t Upgrade
- sh /etc/rc.reboot
+ # If the archive has unpacked a file called
+ # /tmp/no_upgrade_reboot_required then do
+ # not reboot after upgrade.
+ if [ -f /tmp/no_upgrade_reboot_required ]; then
+ rm /tmp/no_upgrade_reboot_required
+ else
+ sh /etc/rc.reboot
+ fi
;;
delta_update)
backup_chflags
@@ -224,7 +238,7 @@ delta_update)
if [ -e /etc/init_bootloader.sh ]; then
sh /etc/init_bootloader.sh
fi
-
+
;;
esac
OpenPOWER on IntegriCloud