From 1289db4899779f7ca085c89c40173b17b2cd8a09 Mon Sep 17 00:00:00 2001 From: Allan Jude Date: Tue, 8 Sep 2015 22:50:17 +0000 Subject: [PATCH] Add an additional check to service(8) -e incase rcvar is blank Approved by: bapt (mentor) X-MFC-With: 287576 Differential Revision: https://reviews.freebsd.org/D3604 --- usr.sbin/service/service.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 96d993a933c8..7aaecff3b255 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -71,7 +71,9 @@ if [ -n "$RESTART" ]; then if grep -q ^rcvar $file; then eval `grep ^name= $file` eval `grep ^rcvar $file` - load_rc_config_var ${name} ${rcvar} + if [ -n "$rcvar" ]; then + load_rc_config_var ${name} ${rcvar} + fi checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop fi done @@ -101,7 +103,9 @@ if [ -n "$ENABLED" ]; then if grep -q ^rcvar $file; then eval `grep ^name= $file` eval `grep ^rcvar $file` - load_rc_config_var ${name} ${rcvar} + if [ -n "$rcvar" ]; then + load_rc_config_var ${name} ${rcvar} + fi checkyesno $rcvar 2>/dev/null && echo $file fi done