summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-02-07 05:36:18 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-02-07 05:36:18 +0000
commitbe3239e3aa25553017afa203ac296b808bc493d5 (patch)
treefec1d119ce6957639d09ff03451f67c98afe6c8b
parentb2774343a3e9d0a3533c7b71f42b6595252ed209 (diff)
downloadpfsense-be3239e3aa25553017afa203ac296b808bc493d5.zip
pfsense-be3239e3aa25553017afa203ac296b808bc493d5.tar.gz
Log upgrade actions to syslog.
-rwxr-xr-xetc/rc.firmware15
-rwxr-xr-xetc/rc.firmware_auto23
2 files changed, 21 insertions, 17 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 141231e..e4e85e8 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -27,7 +27,7 @@ upgrade)
exec </dev/console >/dev/console 2>/dev/console
echo
- echo "Firmware upgrade in progress..."
+ echo "Firmware upgrade in progress..." | logger -p daemon.info -i -t Upgrade
# backup config
mkdir /tmp/configbak
@@ -60,9 +60,8 @@ pfSenseupgrade)
sleep 5
exec </dev/console >/dev/console 2>/dev/console
-
- echo
- echo "Firmware upgrade in progress..."
+
+ echo "Firmware upgrade in progress..." | logger -p daemon.info -i -t Upgrade
# backup config
mkdir /tmp/configbak
@@ -72,8 +71,8 @@ pfSenseupgrade)
# tar explode image onto hd
if [ -r $2 ]; then
- tar xzvPf $2 -U -C / > /dev/null 2>&1
- echo "Image installed."
+ tar xzPf $2 -U -C / | logger -p daemon.info -i -t Upgrade
+ echo "Image installed." | logger -p daemon.info -i -t Upgrade
fi
# restore config
@@ -83,7 +82,7 @@ pfSenseupgrade)
/sbin/umount -f /cf
/sbin/mount -r /cf
- echo "Done - rebooting system..."
- /sbin/reboot
+ echo "Done - rebooting system..." | logger -p daemon.info -i -t Upgrade
+ /sbin/shutdown -r now
;;
esac
diff --git a/etc/rc.firmware_auto b/etc/rc.firmware_auto
index ac1ac95..a5962a3 100755
--- a/etc/rc.firmware_auto
+++ b/etc/rc.firmware_auto
@@ -1,21 +1,26 @@
#!/bin/sh
-echo "Downloading latest.tgz ..."
-cd /tmp && fetch http://www.pfSense.com/latest.tgz
-echo "Downloading latest.tgz.md5 ..."
-cd /tmp && fetch http://www.pfSense.com/latest.tgz.md5
+# wait 5 seconds before beginning
+sleep 5
+
+logger -p daemon.info -i -t AutoUpgrade "Auto Upgrade started"
+
+echo "Downloading latest.tgz ..." | logger -p daemon.info -i -t AutoUpgrade
+cd /tmp && fetch http://www.pfSense.com/latest.tgz | logger -p daemon.info -i -t AutoUpgrade
+echo "Downloading latest.tgz.md5 ..." | logger -p daemon.info -i -t AutoUpgrade
+cd /tmp && fetch http://www.pfSense.com/latest.tgz.md5 | logger -p daemon.info -i -t AutoUpgrade
PMD=`cat /tmp/latest.tgz.md5 | cut -d" " -f4 `;
MD=`/sbin/md5 /tmp/latest.tgz | cut -d" " -f4`;
-echo " Package MD5: ${PMD}"
-echo "Downloaded MD5: ${MD}"
+echo " Package MD5: ${PMD}" | logger -p daemon.info -i -t AutoUpgrade
+echo "Downloaded MD5: ${MD}" | logger -p daemon.info -i -t AutoUpgrade
-if test "$PMD" = "$MD"
- echo "MD5's match."
+if [ "$PMD" = "$MD" ]; then
+ echo "MD5's match." | logger -p daemon.info -i -t AutoUpgrade
/etc/rc.firmware pfSenseupgrade /tmp/latest.tgz
then
- echo "MD5's do not match."
+ echo "MD5's do not match." | logger -p daemon.info -i -t AutoUpgrade
exit 0
fi
OpenPOWER on IntegriCloud