File: dnetd

package info (click to toggle)
dnprogs 2.52
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,644 kB
  • ctags: 4,021
  • sloc: ansic: 26,737; cpp: 10,666; makefile: 832; sh: 537; awk: 13
file content (77 lines) | stat: -rw-r--r-- 1,821 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/sbin/runscript
#
# /etc/init.d/dnetd
#
# Starts/Stops DECnet processes
#
# description:  DECnet.
# processname: dnetd
# config: /etc/decnet.conf
#
#
# This script should go in
#  /etc/init.d for Gentoo Linux
#
# You can install it using the following command:
#
# rc-update add dnetd default
#
# -----------------------------------------------------------------------------
#

depend() {
	before net.${ETHER}
}

checkconfig() {
     [[ ! -f /etc/decnet.conf ]] && echo $"DECnet not started as it is not configured." && return 1

     # If there is no DECnet in the kernel then try to load it.
     [[ ! -f /proc/net/decnet ]] && modprobe decnet
     [[ ! -f /proc/net/decnet ]] && echo $"DECnet not started as it is not in the kernel." && return 1
}

start() {
	local myopts="/var/run/${SVCNAME}.pid"

        checkconfig || (echo "not checked good" && return 1) 
     	#echo -n $"Starting DECnet: "
     	NODE=`grep executor /etc/decnet.conf| awk '{print $2}'`
     	echo "$NODE" > /proc/sys/net/decnet/node_address
     	CCT=`grep executor /etc/decnet.conf | awk '{print $6}'`
     	echo "$CCT" > /proc/sys/net/decnet/default_device
     	$prefix/sbin/setether $NODE $CCT $extra_interfaces 
        ebegin "Starting ${SVCNAME}"
	
	     for i in $daemons
	     do
	       echo "	starting $i";
	       start-stop-daemon --start --startas $prefix/sbin/$i --name dnetd
	      # echo -n $" `eval echo $startecho`"
	     done
	     #echo $"$startendecho"

        eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --quiet --exec dnetd
        eend $?
}

reload() {
        ebegin "Reloading ${SVCNAME}"
        start-stop-daemon --stop --quiet --pidfile /var/run/${SVCNAME}.pid \
                --signal HUP
        eend $?
}


restart() {
	svc_stop
	svc_start
        eend $?
}