File: init

package info (click to toggle)
oidentd 2.0.8-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,156 kB
  • ctags: 931
  • sloc: ansic: 6,276; sh: 3,425; yacc: 370; lex: 335; makefile: 45
file content (57 lines) | stat: -rw-r--r-- 1,298 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
#
# Start/stops the oident daemon.
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin
OIDENTD=/usr/sbin/oidentd

# See if the daemons are there
test -f ${OIDENTD} || exit 0

# oidentd configuration
OIDENT_OPTIONS=""
OIDENT_USER="nobody"
OIDENT_GROUP="nogroup"
test -f /etc/default/oidentd && . /etc/default/oidentd

if [ "${OIDENT_BEHIND_PROXY}" = "yes" ]; then
  # If we have a default router, then allow it to proxy auth requests to us
  GATEWAY=`netstat -nr | awk '/^0.0.0.0/{print $2;}'`
  if [ -n "${GATEWAY}" ]; then
    OIDENT_OPTIONS="${OIDENT_OPTIONS} -P ${GATEWAY}"
  fi
fi
 

OPTIONS="${OIDENT_OPTIONS} -u ${OIDENT_USER} -g ${OIDENT_GROUP}"

case "$1" in
	start)
		echo -n "Starting ident daemon:"
		echo -n " oidentd"
		start-stop-daemon --start --quiet --exec ${OIDENTD} -- ${OPTIONS}
		echo "."
		;;
	stop)
		echo -n "Stopping ident daemon:"
		echo -n " oidentd"
		start-stop-daemon --stop --quiet --exec ${OIDENTD} -- ${OPTIONS}
		echo "."
		;;
	reload|restart|force-reload)
		echo -n "Restarting ident daemon:"
		echo -n " oidentd"
		start-stop-daemon --stop --quiet --exec ${OIDENTD} -- ${OPTIONS}
		sleep 2
		start-stop-daemon --start --quiet --exec ${OIDENTD} -- ${OPTIONS}
		echo "."
		;;
	*)
		echo "Usage: $0 {start|stop|restart|reload|force-reload}"
		exit 1
		;;
esac

exit 0