Author: allanjude
Date: Tue Sep  8 22:50:17 2015
New Revision: 287581
URL: https://svnweb.freebsd.org/changeset/base/287581

Log:
  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

Modified:
  head/usr.sbin/service/service.sh

Modified: head/usr.sbin/service/service.sh
==============================================================================
--- head/usr.sbin/service/service.sh    Tue Sep  8 22:24:20 2015        
(r287580)
+++ head/usr.sbin/service/service.sh    Tue Sep  8 22:50:17 2015        
(r287581)
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to