~ubuntu-branches/ubuntu/precise/netatalk/precise

« back to all changes in this revision

Viewing changes to distrib/initscripts/rc.atalk.sysv

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Rittau
  • Date: 2004-01-19 12:43:49 UTC
  • Revision ID: james.westby@ubuntu.com-20040119124349-es563jbp0hk0ae51
Tags: upstream-1.6.4
ImportĀ upstreamĀ versionĀ 1.6.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
#
 
11
# kill the named process(es)
 
12
#
 
13
killproc() {
 
14
        pid=`/usr/bin/ps -e |
 
15
             /usr/bin/grep $1 |
 
16
             /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
 
17
        [ "$pid" != "" ] && kill $pid
 
18
}
 
19
 
 
20
case "$1" in
 
21
 
 
22
#
 
23
# Start the appletalk server processes.
 
24
#
 
25
 
 
26
'start')
 
27
 
 
28
        echo 'starting appletalk daemons: \c'
 
29
        if [ -x :SBINDIR:/atalkd ]; then
 
30
                :SBINDIR:/atalkd;               echo ' atalkd\c'
 
31
        fi
 
32
 
 
33
        if [ -x :BINDIR:/nbprgstr ]; then
 
34
                :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation
 
35
                :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk
 
36
                                                echo ' nbprgstr\c'
 
37
        fi
 
38
 
 
39
        if [ -x :SBINDIR:/papd ]; then
 
40
                :SBINDIR:/papd;                 echo ' papd\c'
 
41
        fi
 
42
 
 
43
        if [ -x :SBINDIR:/afpd ]; then
 
44
                :SBINDIR:/afpd;                 echo ' afpd\c'
 
45
        fi
 
46
 
 
47
        if [ -x :SBINDIR:/timelord ]; then
 
48
                :SBINDIR:/timelord;             echo ' timelord\c'
 
49
        fi
 
50
 
 
51
        echo '.'
 
52
 
 
53
        ;;
 
54
 
 
55
#
 
56
# Stop the appletalk server processes.
 
57
#
 
58
 
 
59
'stop')
 
60
 
 
61
        echo 'stopping appletalk daemons:\c'
 
62
 
 
63
        if [ -x :SBINDIR:/papd ]; then
 
64
                killproc papd;                  echo ' papd\c'
 
65
        fi
 
66
 
 
67
        if [ -x :SBINDIR:/afpd ]; then
 
68
                killproc afpd;                  echo ' afpd\c'
 
69
        fi
 
70
 
 
71
        if [ -x :SBINDIR:/timelord ]; then
 
72
                killproc timelord;              echo ' timelord\c'
 
73
        fi
 
74
 
 
75
        # kill atalkd last, since without it the plumbing goes away.
 
76
        if [ -x :SBINDIR:/atalkd ]; then
 
77
                killproc atalkd;                echo ' atalkd\c'
 
78
        fi
 
79
 
 
80
        echo '.'
 
81
        ;;
 
82
 
 
83
#
 
84
# Usage statement.
 
85
#
 
86
 
 
87
*)
 
88
        echo "usage: $0 {start|stop}"
 
89
        exit 1
 
90
        ;;
 
91
esac