File: sshproxy.init

package info (click to toggle)
sshproxy 0.6.0~beta2-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 956 kB
  • ctags: 1,296
  • sloc: python: 8,932; sh: 268; sql: 40; makefile: 38; xml: 21
file content (60 lines) | stat: -rw-r--r-- 1,481 bytes parent folder | download
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
#! /bin/sh
#
### BEGIN INIT INFO
# Provides:          sshproxy
# Required-Start:    $network
# Required-Stop:     $network
# Should-Start:      $syslog
# Should-Stop:       $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: ssh gateway to apply ACLs on ssh connections
# Description:       sshproxy is a pure python implementation of an ssh proxy.
#                    It allows users to connect to remote sites without having to remember
#                    the password or key of the remote sites.
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/sshproxyd
NAME=sshproxy
DESC=sshproxy

test -x $DAEMON || exit 0

# Include sshproxy defaults if available
if [ -f /etc/default/sshproxy ] ; then
	. /etc/default/sshproxy
fi

if [ "$SSHPROXYD_ENABLED" = "no" ]; then
	echo 'Please set SSHPROXYD_ENABLED="yes" in /etc/default/sshproxy'
	exit 0
fi

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: "
	start-stop-daemon --start --quiet --pidfile /var/run/sshproxyd.pid \
		--exec $DAEMON -- --daemon --user $SSHPROXYD_USER --config-dir $SSHPROXYD_CONFDIR \
		--pid /var/run/sshproxyd.pid
	echo "$NAME."
	;;
  stop)
	echo -n "Stopping $DESC: "
	start-stop-daemon --stop --quiet --pidfile /var/run/sshproxyd.pid --oknodo
	echo "$NAME."
	;;
  restart|force-reload)
	$0 stop
	$0 start
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0