diff options
author | allanjude <allanjude@FreeBSD.org> | 2015-09-08 22:50:17 +0000 |
---|---|---|
committer | allanjude <allanjude@FreeBSD.org> | 2015-09-08 22:50:17 +0000 |
commit | 8779e555536977613e152b58b812cc2c7751bc38 (patch) | |
tree | f9e6c52f9b50d50271085986331a97ab5eb4bbed /usr.sbin/service/service.sh | |
parent | 390f3fc8ff50e82f1c94eb582053c8641b5c255c (diff) | |
download | FreeBSD-src-8779e555536977613e152b58b812cc2c7751bc38.zip FreeBSD-src-8779e555536977613e152b58b812cc2c7751bc38.tar.gz |
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
Diffstat (limited to 'usr.sbin/service/service.sh')
-rwxr-xr-x | usr.sbin/service/service.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 96d993a..7aaecff 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 |