wok-stable diff unfs3/stuff/etc/init.d/unfsd @ rev 4342
unfs3: /etc/export -> /etc/exports
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Oct 01 18:35:07 2009 +0200 (2009-10-01) |
parents | |
children | 1b6281d68d9f |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/unfs3/stuff/etc/init.d/unfsd Thu Oct 01 18:35:07 2009 +0200 1.3 @@ -0,0 +1,57 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/unfsd : Start, stop and restart NFSv3 Server on SliTaz, at 1.6 +# boot time or with the command line. 1.7 +# 1.8 +# To start NFSv3 Server at boot time, just put dropbear in the $RUN_DAEMONS 1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf 1.10 +# 1.11 +. /etc/init.d/rc.functions 1.12 +. /etc/daemons.conf 1.13 + 1.14 +NAME=unfsd 1.15 +DESC="NFSv3 Server" 1.16 +DAEMON=/usr/bin/unfsd 1.17 +OPTIONS= 1.18 +PIDFILE=/var/run/$NAME.pid 1.19 + 1.20 + 1.21 +test -f $DAEMON || exit 0 1.22 + 1.23 +case "$1" in 1.24 + start) 1.25 + if [ -f $PIDFILE ] ; then 1.26 + echo "$NAME already running." 1.27 + exit 1 1.28 + fi 1.29 + 1.30 + echo -n "Starting $DESC: $NAME... " 1.31 + $DAEMON $OPTIONS 1.32 + status 1.33 + 1.34 + # registering PID 1.35 + if [ $? -eq 0 ]; then 1.36 + pidof -s $NAME > $PIDFILE 1.37 + fi 1.38 + ;; 1.39 + stop) 1.40 + if [ ! -f $PIDFILE ] ; then 1.41 + echo "$NAME is not running." 1.42 + exit 1 1.43 + fi 1.44 + echo -n "Stopping $DESC: $NAME... " 1.45 + kill `cat $PIDFILE` 1.46 + rm -f $PIDFILE 1.47 + status 1.48 + ;; 1.49 + restart) 1.50 + $0 stop 1.51 + $0 start 1.52 + ;; 1.53 + *) 1.54 + echo "Usage: $DAEMON {start|stop|reload|restart}" 1.55 + exit 1 1.56 + ;; 1.57 +esac 1.58 + 1.59 +exit 0 1.60 +