From ad615b8aac32c1bd2f891015881a22cb540c7f5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 19 Oct 2006 10:32:50 +0000 Subject: [PATCH] - use functions Changed files: nfsfs.init -> 1.27 nfslock.init -> 1.12 --- nfsfs.init | 22 +++++++++++++++------- nfslock.init | 25 ++++++++++++++++--------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/nfsfs.init b/nfsfs.init index 38e567a..933ca32 100644 --- a/nfsfs.init +++ b/nfsfs.init @@ -36,9 +36,7 @@ else exit 0 fi -# See how we were called. -case "$1" in - start) +start() { if [ ! -f /var/lock/subsys/nfsfs ]; then if is_yes "$NFS4" ; then if grep -q nfs4 /proc/filesystems; then @@ -61,8 +59,9 @@ case "$1" in else msg_already_running "NFSFS" fi - ;; - stop) +} + +stop() { if [ -f /proc/mounts ]; then fsfile="/proc/mounts" else @@ -94,6 +93,15 @@ case "$1" in fi fi rm -f /var/lock/subsys/nfsfs +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop ;; status) if [ -f /proc/mounts ]; then @@ -108,8 +116,8 @@ case "$1" in fi ;; restart) - $0 stop - $0 start + stop + start ;; reload|force-reload) mount -a -t nfs diff --git a/nfslock.init b/nfslock.init index df555d7..4ab609f 100644 --- a/nfslock.init +++ b/nfslock.init @@ -35,10 +35,7 @@ fi # Sanity checks [ -x /usr/sbin/rpc.statd ] || exit 0 -RETVAL=0 -# See how we were called. -case "$1" in - start) +start() { # Check if the service is already running? if [ ! -f /var/lock/subsys/nfslock ]; then # Start daemons. @@ -49,8 +46,9 @@ case "$1" in else msg_already_running "NFS statd" fi - ;; - stop) +} + +stop() { if [ -f /var/lock/subsys/nfslock ]; then # Stop daemons. msg_stopping "NFS statd" @@ -59,15 +57,24 @@ case "$1" in else msg_not_running "NFS statd" fi +} + +RETVAL=0 +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop ;; status) status rpc.statd exit $? ;; restart|force-reload) - $0 stop - $0 start - exit $? + stop + start ;; probe) if [ ! -f /var/lock/subsys/nfslock ]; then -- 2.44.0