]> arthur.barton.de Git - netatalk.git/blob - distrib/initscripts/rc.atalk.tru64.tmpl
Changes made by Michel Jouvin - jouvin@lal.in2p3.fr - 23/11/2000
[netatalk.git] / distrib / initscripts / rc.atalk.tru64.tmpl
1 #! /bin/sh
2 #
3 # Start/stop the AppleTalk daemons.
4 #
5 # AppleTalk daemons. Make sure not to start atalkd in the background:
6 # its data structures must have time to stablize before running the
7 # other processes.
8 #
9
10 ATALK_BIN=:BINDIR:
11 ATALK_CONF_DIR=:ETCDIR:
12 ATALK_SBIN=:SBINDIR:
13
14 ATALK_START_ATALKD=0
15 ATALK_START_NBPRGSTR=0
16 ATALK_START_PAPD=0
17 ATALK_START_AFPD=1
18 ATALK_START_TIMELORD=0
19
20 #
21 # kill the named process(es)
22 #
23 killproc() {
24         pid=`/usr/bin/ps -e |
25              /usr/bin/grep $1 |
26              /usr/bin/grep -v grep |
27              /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
28         [ "$pid" != "" ] && kill $pid
29 }
30
31 case "$1" in
32
33 #
34 # Start the appletalk server processes.
35 #
36
37 'start')
38
39         echo 'starting appletalk daemons: \c'
40         if [ ${ATALK_START_ATALKD} -eq 1 -a -x ${ATALK_SBIN}/atalkd ]; then
41                 ${ATALK_SBIN}/atalkd;           echo ' atalkd\c'
42         fi
43
44         if [ ${ATALK_START_NBPRGSTR} -eq 1 -a -x ${ATALK_BIN}/nbprgstr ]; then
45                 ${ATALK_BIN}/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation
46                 ${ATALK_BIN}/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk
47                                                 echo ' nbprgstr\c'
48         fi
49
50         if [ ${ATALK_START_PAPD} -eq 1 -a -x ${ATALK_SBIN}/papd ]; then
51                 ${ATALK_SBIN}/papd;                     echo ' papd\c'
52         fi
53
54         if [ ${ATALK_START_AFPD} -eq 1 -a -x ${ATALK_SBIN}/afpd ]; then
55                 ${ATALK_SBIN}/afpd;                     echo ' afpd\c'
56         fi
57
58         if [ ${ATALK_START_TIMELORD} -eq 1 -a -x ${ATALK_SBIN}/timelord ]; then
59                 ${ATALK_SBIN}/timelord;         echo ' timelord\c'
60         fi
61
62         echo '.'
63
64         ;;
65
66 #
67 # Stop the appletalk server processes.
68 #
69
70 'stop')
71
72         echo 'stopping appletalk daemons:\c'
73
74         if [ -x ${ATALK_SBIN}/papd ]; then
75                 killproc papd;                  echo ' papd\c'
76         fi
77
78         if [ -x ${ATALK_SBIN}/afpd ]; then
79                 killproc afpd;                  echo ' afpd\c'
80         fi
81
82         if [ -x ${ATALK_SBIN}/timelord ]; then
83                 killproc timelord;              echo ' timelord\c'
84         fi
85
86         # kill atalkd last, since without it the plumbing goes away.
87         if [ -x ${ATALK_SBIN}/atalkd ]; then
88                 killproc atalkd;                echo ' atalkd\c'
89         fi
90
91         echo '.'
92         ;;
93
94 #
95 # Usage statement.
96 #
97
98 *)
99         echo "usage: $0 {start|stop}"
100         exit 1
101         ;;
102 esac