diff options
author | jpaetzel <jpaetzel@FreeBSD.org> | 2011-03-27 16:57:54 +0000 |
---|---|---|
committer | jpaetzel <jpaetzel@FreeBSD.org> | 2011-03-27 16:57:54 +0000 |
commit | c0b9051b174edd52b1c981a25a28d77d5133a049 (patch) | |
tree | 7685cacc260db6392774e2cc0fe2507f4afd24ba /usr.sbin/pc-sysinstall/backend/functions-runcommands.sh | |
parent | 79f5bd9d163ed51b54be37305ac97c975667db20 (diff) | |
download | FreeBSD-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/functions-runcommands.sh')
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend/functions-runcommands.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh b/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh index fccc00a..b364823 100755 --- a/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh +++ b/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh @@ -82,24 +82,24 @@ run_commands() while read line do # Check if we need to run any chroot command - echo $line | grep ^runCommand= >/dev/null 2>/dev/null - if [ "$?" = "0" ] + echo $line | grep -q ^runCommand= 2>/dev/null + if [ $? -eq 0 ] then get_value_from_string "$line" run_chroot_cmd "$VAL" fi # Check if we need to run any chroot script - echo $line | grep ^runScript= >/dev/null 2>/dev/null - if [ "$?" = "0" ] + echo $line | grep -q ^runScript= 2>/dev/null + if [ $? -eq 0 ] then get_value_from_string "$line" run_chroot_script "$VAL" fi # Check if we need to run any chroot command - echo $line | grep ^runExtCommand= >/dev/null 2>/dev/null - if [ "$?" = "0" ] + echo $line | grep -q ^runExtCommand= 2>/dev/null + if [ $? -eq 0 ] then get_value_from_string "$line" run_ext_cmd "$VAL" |