aboutsummaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2000-03-31 20:36:28 +0000
committerBill Nottingham <notting@redhat.com>2000-03-31 20:36:28 +0000
commitdb538e83c5f3e2b463a9edda232c1cba946733c8 (patch)
treefcb9f896fe552ef3769adb39fbe5806e2ad5544b /service
parent8cc513bfc49d68b7951fd094b1747f638d898ae0 (diff)
downloadinitscripts-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-xservice14
1 files changed, 10 insertions, 4 deletions
diff --git a/service b/service
index 8e9ceaad..0a6d297b 100755
--- a/service
+++ b/service
@@ -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