File: init

package info (click to toggle)
gom 0.29.103-11
  • links: PTS
  • area: main
  • in suites: woody
  • size: 572 kB
  • ctags: 319
  • sloc: ansic: 3,206; sh: 910; makefile: 80
file content (72 lines) | stat: -rw-r--r-- 1,601 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh -e
#
# bootup for gom 0.29.99+: initialize mixer(s)
#
# $Id: init,v 1.5 2002/02/10 19:46:04 absurd Exp $
#
# (c) 1998-2001 Stephan A Suerken <absurd@debian.org>
#

#
# Where adm default values can be stored
#
gom_defaults=/etc/default/gom
gom_cmd=/usr/bin/gom-ct

#
# Variable script defaults; Customize in /etc/default/gom if needed.
#
auto_init=no
valid_sound_devices="sound alsa"

#
# Variable admin default
#
[ ! -e ${gom_defaults} ] || . ${gom_defaults}

#
# Silent exits
#
# Explicit configuration
[ "${auto_init}" = "yes" ] || exit 0
# gom.deb is removed but not purged
[ -x ${gom_cmd} ] || exit 0

# valid sound device there? (this works for (at least) kernels 2.2.x and 2.4.x)
sound_device=""
for d in ${valid_sound_devices}; do
    if grep --quiet ${d} /proc/devices;
       then sound_device=${d};
            break;
    fi;
done
[ "${sound_device}" ] || exit 0

#
# Initialization
#
case "$1" in
	# At this point, gom is installed properly and the (oss) sound
	# driver is present.
	# Won't fail even if configuration is invalid.
	start|restart|reload|force-reload)
		echo -n "Gom initializing audio mixer(s)..."
		if ${gom_cmd} --quiet --initialize >/dev/null 2>&1 ;
#		if ${gom_cmd} --quiet --initialize ;
		    then echo "done."
		    else echo "some errors. Check 'gom --initialize'."
		fi
		;;
	stop)
		;;
	*)
		echo "Usage: /etc/init.d/gom {start|restart|reload|force-reload|stop}" >&2
		echo
		echo "       start|restart|reload|force-reload  initializes audio mixer(s)." >&2
		echo "       stop                               does nothing." >&2
		exit 1
		;;
esac

exit 0