From 6fa3ee6c307d9b0caa3b9c00b757f488b9fe3bc9 Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Wed, 26 Oct 2005 04:32:31 +0000 Subject: [PATCH] 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) --- etc/rc.subr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/etc/rc.subr b/etc/rc.subr index bff3620a522..4ed122a2e19 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=