summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/rc.firmware23
1 files changed, 14 insertions, 9 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index c5fb587..0681f44 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -11,7 +11,9 @@
export ACTION=$1
export IMG=$2
-export CUSTOMIMG=$3
+if [ $# -eq 3 ]; then
+ export CUSTOMIMG=$3
+fi
if [ $ACTION != "upgrade" ]; then
/sbin/umount -f /ftmp > /dev/null 2>&1
@@ -160,14 +162,17 @@ pfSenseupgrade)
/usr/bin/find / -name CVS -exec rm -fr {} \;
echo "Image installed $IMG." | logger -p daemon.info -i -t Upgrade
- # process custom image if its passed
- if [ -f $CUSTOMIMG ]; then
- echo "Custom image $CUSTOMIMG found." | logger -p daemon.info -i -t Upgrade
- PWD_DIR=`pwd`
- cd / && /usr/bin/tar xzPUf $CUSTOMIMG | logger -p daemon.info -i -t Upgrade
- cd $PWD_DIR
- echo "Custom image $CUSTOMIMG installed." | logger -p daemon.info -i -t Upgrade
- fi
+ # process custom image if its passed
+ 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."
+ PWD_DIR=`pwd`
+ cd / && /usr/bin/tar xzPUf $CUSTOMIMG | logger -p daemon.info -i -t Upgrade
+ cd $PWD_DIR
+ echo "Custom image $CUSTOMIMG installed." | logger -p daemon.info -i -t Upgrade
+ fi
+ fi
# restore config
cp -p /tmp/configbak/* /conf 2>/dev/null
OpenPOWER on IntegriCloud