diff options
author | Bill Nottingham <notting@redhat.com> | 2000-03-31 20:36:28 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2000-03-31 20:36:28 +0000 |
commit | db538e83c5f3e2b463a9edda232c1cba946733c8 (patch) | |
tree | fcb9f896fe552ef3769adb39fbe5806e2ad5544b /service | |
parent | 8cc513bfc49d68b7951fd094b1747f638d898ae0 (diff) | |
download | initscripts-db538e83c5f3e2b463a9edda232c1cba946733c8.tar initscripts-db538e83c5f3e2b463a9edda232c1cba946733c8.tar.gz initscripts-db538e83c5f3e2b463a9edda232c1cba946733c8.tar.bz2 initscripts-db538e83c5f3e2b463a9edda232c1cba946733c8.tar.xz initscripts-db538e83c5f3e2b463a9edda232c1cba946733c8.zip |
add full restart (stop/start) <ivanyi@internet.sk>
Diffstat (limited to 'service')
-rwxr-xr-x | service | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,11 +1,10 @@ #!/bin/sh -VERSION="`basename $0` ver. 0.9" +VERSION="`basename $0` ver. 0.91" USAGE="Usage: `basename $0` < option > | --status-all | \ -[ service_name [ command ] ]" +[ service_name [ command | --full-restart ] ]" SERVICE= SERVICEDIR="/etc/rc.d/init.d" -PWD=`pwd` if [ $# -eq 0 ]; then echo "${USAGE}" >&2 @@ -38,8 +37,15 @@ do ;; esac done - cd "${PWD}" exit 0 + elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then + SERVICE="${1}" + cd "${SERVICEDIR}" + if [ -x "${SERVICEDIR}/${SERVICE}" ]; then + "${SERVICEDIR}/${SERVICE}" stop + "${SERVICEDIR}/${SERVICE}" start + exit $? + fi elif [ -z "${SERVICE}" ]; then SERVICE="${1}" else |