File: brltty.init

package info (click to toggle)
brltty 5.6-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 25,116 kB
  • sloc: ansic: 117,871; sh: 6,590; java: 4,785; xml: 3,451; makefile: 1,973; tcl: 1,499; awk: 611; ml: 293; python: 250; lisp: 52
file content (73 lines) | stat: -rw-r--r-- 1,696 bytes parent folder | download | duplicates (4)
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
#! /bin/sh
### BEGIN INIT INFO
# Provides:          brltty
# Required-Start:    mountkernfs
# Required-Stop:     
# Should-Start:      udev
# Should-Stop:
# Default-Start:     S
# Default-Stop:
# Short-Description: Braille terminal driver 
# Description: Used to provide access to refreshable braille terminals.
### END INIT INFO

set -e

DAEMON=/bin/brltty
NAME=brltty
DESC='Braille terminal driver'

test -f $DAEMON || exit 0

[ -r /etc/default/brltty ] && . /etc/default/brltty

[ -r /etc/default/locale ] && . /etc/default/locale
[ -n "$LANG" ] && export LANG

. /lib/lsb/init-functions

case "$1" in
  start)
	if [ "$RUNLEVEL" = "S" -a "$PREVLEVEL" = "N" ]; then
		if [ "$START_IN_INITRAMFS" = "true" -o "$START_IN_INITRAMFS" = "yes" ]; then
			if $0 status >/dev/null; then
				$0 stop
			else
				log_warning_msg 'BRLTTY was not running, did you forget to invoke "update-initramfs -u"?'
			fi
		fi
	fi
	log_daemon_msg "Starting $DESC" "$NAME"
	if start-stop-daemon --start --oknodo --exec $DAEMON -- $ARGUMENTS; then
	    log_end_msg 0
	else
	    log_end_msg 1
	fi
	;;
  stop)
	log_daemon_msg "Stopping $DESC" "$NAME"
	if start-stop-daemon --stop --quiet --oknodo --retry 5 --exec $DAEMON; then
	    log_end_msg 0
	else
	    log_end_msg 1
	fi
	;;
  restart|force-reload)
	log_daemon_msg "Restarting $DESC" "$NAME"
	start-stop-daemon --stop --quiet --retry 5 --exec $DAEMON
	if start-stop-daemon --start --quiet --exec $DAEMON -- $ARGUMENTS; then
	    log_end_msg 0
	else
	    log_end_msg 1
	fi
	;;
  status)
        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
        ;;
  *)
	echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2
	exit 1
	;;
esac

exit 0