diff options
-rwxr-xr-x | etc/rc.firmware | 7 | ||||
-rwxr-xr-x | etc/rc.firmware_auto | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware index e4e85e8..6370e1b 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -75,6 +75,13 @@ pfSenseupgrade) echo "Image installed." | logger -p daemon.info -i -t Upgrade fi + # process custom image if its passed + if [ -r $3 ]; then + echo "Custom image $3 found." | logger -p daemon.info -i -t Upgrade + tar xzPf $3 -U -C / | logger -p daemon.info -i -t Upgrade + echo "Custom image $3 installed." | logger -p daemon.info -i -t Upgrade + fi + # restore config cp -p /tmp/configbak/* /conf diff --git a/etc/rc.firmware_auto b/etc/rc.firmware_auto index a6d8fec..da83aab 100755 --- a/etc/rc.firmware_auto +++ b/etc/rc.firmware_auto @@ -35,7 +35,11 @@ fi if [ "$PMD" = "$MD" ]; then echo "MD5's match." | logger -p daemon.info -i -t AutoUpgrade - /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz + if [ -e "/tmp/custom.tgz" ]; then + /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz /tmp/custom.tgz + else + /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz + fi exit 0 fi |