summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2005-10-26 04:32:31 +0000
committeryar <yar@FreeBSD.org>2005-10-26 04:32:31 +0000
commit4f42d603be95c50d65887debc89052e41b204f45 (patch)
tree05909df6c9b7b823d5174a8c73d2af456abeec9b
parent4a93cc5bfd85a58dcffb3863361e5ad288a7efda (diff)
downloadFreeBSD-src-4f42d603be95c50d65887debc89052e41b204f45.zip
FreeBSD-src-4f42d603be95c50d65887debc89052e41b204f45.tar.gz
Override $command with $foo_program only if $command
has been set in the first place. This should reduce unwanted side-effects in rc.d scripts that don't mean to use $command and rc.subr(8) methods associated with it at all. Discussed with: brooks Reviewed by: -rc (silence)
-rw-r--r--etc/rc.subr4
1 files changed, 1 insertions, 3 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index bff3620..4ed122a 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -495,9 +495,7 @@ run_rc_command()
esac
eval _overide_command=\$${name}_program
- if [ -n "$_overide_command" ]; then
- command=$_overide_command
- fi
+ command=${command:+${_overide_command:-$command}}
_keywords="start stop restart rcvar $extra_commands"
rc_pid=
OpenPOWER on IntegriCloud