diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-04-16 00:32:15 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-04-16 00:32:15 +0000 |
commit | 97ab7fdc5d81556b8be6f69393a4f0ec70bddbb6 (patch) | |
tree | f85c73b1e62f11a191058edcad2718d4aaba7905 /etc | |
parent | feb570f1c656165bc8eada3a693e240b58c21b9a (diff) | |
download | pfsense-97ab7fdc5d81556b8be6f69393a4f0ec70bddbb6.zip pfsense-97ab7fdc5d81556b8be6f69393a4f0ec70bddbb6.tar.gz |
Do not process custom image unless it really exists.
Before it was detecting an image of "" and triggering the -C error.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.firmware | 23 |
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 |