]>
Commit | Line | Data |
---|---|---|
2c9e731e | 1 | #!/bin/sh |
2 | # | |
3 | # aumix Sound mixer setup. | |
4 | # | |
5 | # chkconfig: 345 85 15 | |
6 | # | |
7 | # description: Saves sound mixer's settings on system shutdown and restores | |
8 | # them on system startup. | |
9 | ||
10 | # Source function library | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # See how we were called. | |
14 | case "$1" in | |
15 | start) | |
16 | # Check if the service is already running? | |
17 | if [ ! -f /var/lock/subsys/aumix ]; then | |
18 | show "Setting up sound card mixer" | |
19 | busy | |
20 | aumix -f /etc/aumixrc -L >/dev/null | |
21 | RETVAL=$? | |
22 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/aumix | |
23 | ok | |
24 | else | |
25 | # show "%s service is already running." <service> | |
26 | nls "Sound card mixer is already set up" | |
27 | exit 1 | |
28 | fi | |
29 | ;; | |
30 | stop) | |
31 | # Stop daemons. | |
32 | if [ -f /var/lock/subsys/aumix ]; then | |
33 | show "Saving sound card mixer's settings" | |
34 | busy | |
35 | aumix -f /etc/aumixrc -S | |
36 | rm -f /var/lock/subsys/aumix >/dev/null 2>&1 | |
37 | ok | |
38 | else | |
39 | nls "Sound card mixer hasn't been set up" | |
40 | exit 1 | |
41 | fi | |
42 | ;; | |
43 | restart) | |
44 | $0 stop | |
45 | $0 start | |
46 | ;; | |
47 | save) | |
48 | show "Saving sound card mixer's settings" | |
49 | busy | |
50 | aumix -f /etc/aumixrc -S | |
51 | ok | |
52 | ;; | |
53 | restore) | |
54 | show "Setting up sound card mixer" | |
55 | busy | |
56 | aumix -f /etc/aumixrc -L >/dev/null | |
57 | ok | |
58 | ;; | |
59 | status) | |
60 | status aumix | |
61 | exit $? | |
62 | ;; | |
63 | *) | |
64 | msg_Usage "$0 {start|stop|status|restart|save|restore}" | |
65 | exit 1 | |
66 | esac | |
67 | ||
68 | exit $RETVAL |