summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pc-sysinstall/backend/startautoinstall.sh
diff options
context:
space:
mode:
authorjpaetzel <jpaetzel@FreeBSD.org>2011-03-27 16:57:54 +0000
committerjpaetzel <jpaetzel@FreeBSD.org>2011-03-27 16:57:54 +0000
commitc0b9051b174edd52b1c981a25a28d77d5133a049 (patch)
tree7685cacc260db6392774e2cc0fe2507f4afd24ba /usr.sbin/pc-sysinstall/backend/startautoinstall.sh
parent79f5bd9d163ed51b54be37305ac97c975667db20 (diff)
downloadFreeBSD-src-c0b9051b174edd52b1c981a25a28d77d5133a049.zip
FreeBSD-src-c0b9051b174edd52b1c981a25a28d77d5133a049.tar.gz
Fix a syntax error in a little-used function.
Replace expr with $(()) Replace grep > /dev/null with grep -q Replace "$?" = "0" with $? -eq 0 in tests Consolidate export statements with variable assignment Replace tests for ! -z with -n Approved by: kib (mentor)
Diffstat (limited to 'usr.sbin/pc-sysinstall/backend/startautoinstall.sh')
-rwxr-xr-xusr.sbin/pc-sysinstall/backend/startautoinstall.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/startautoinstall.sh b/usr.sbin/pc-sysinstall/backend/startautoinstall.sh
index 93d9274..66cbe36 100755
--- a/usr.sbin/pc-sysinstall/backend/startautoinstall.sh
+++ b/usr.sbin/pc-sysinstall/backend/startautoinstall.sh
@@ -49,8 +49,8 @@ SHUTDOWN_CMD=`grep "shutdown_cmd:" ${CONF} | grep -v "^#" | sed "s|shutdown_cmd:
CONFIRM_INS=`grep "confirm_install:" ${CONF} | grep -v "^#" | sed "s|confirm_install: ||g" | sed "s|confirm_install:||g"`
# Check that this isn't a http / ftp file we need to fetch later
-echo "${PCCFG}" | grep -e "^http" -e "^ftp" > /dev/null 2>/dev/null
-if [ "$?" != "0" ]
+echo "${PCCFG}" | grep -q -e "^http" -e "^ftp" 2>/dev/null
+if [ $? -ne 0 ]
then
# Copy over the install cfg file, if not done already
if [ ! -e "${INSTALL_CFG}" ]
@@ -92,7 +92,7 @@ else
# Now try to fetch the remove file
echo "Fetching cfg with: \"fetch -o ${INSTALL_CFG} ${PCCFG}\""
fetch -o "${INSTALL_CFG}" "${PCCFG}"
- if [ "$?" != "0" ]
+ if [ $? -ne 0 ]
then
echo "ERROR: Failed to fetch ${PCCFG}, install aborted"
exit 150
@@ -115,9 +115,9 @@ then
fi
${PROGDIR}/pc-sysinstall -c ${INSTALL_CFG}
- if [ "$?" = "0" ]
+ if [ $? -eq 0 ]
then
- if [ ! -z "$SHUTDOWN_CMD" ]
+ if [ -n "$SHUTDOWN_CMD" ]
then
${SHUTDOWN_CMD}
else
OpenPOWER on IntegriCloud