summaryrefslogtreecommitdiffstats
path: root/oss-hg/oss.rc
blob: 1724aa2b3e8a36aeb9a663fcc4ee142bd4e0ce01 (plain)
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
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
 start)
	if [ "${msg_lang}" = "cn" ]; then
		stat_busy "正在启动 OSS 开源驱动"
	else
		stat_busy "Starting OSS/Open source driver"
	fi
   # start
   /usr/sbin/soundon
   if [ $? -gt 0 ]; then
     stat_fail
   else
     grep '^softoss' /proc/modules >/dev/null 2>/dev/null
#      if [ $? -eq 0 ]; then
#        stat_busy "Replacing old \"softoss\" module with \"vmix\""
#        rmmod softoss
#        modprobe vmix
#        sed -i 's/^softoss.*$/vmix/' /usr/lib/oss/etc/installed_drivers
#      fi
     add_daemon oss4
     stat_done
   fi
   ;;
 stop)
   if [ "${msg_lang}" = "cn" ]; then
   	stat_busy "正在保存 OSS 设置"
   else
   	stat_busy "Saving OSS mixer"
   fi
   /usr/sbin/savemixer
   if [ $? -gt 0 ]; then
     stat_fail
   else
     stat_done
   fi
   grep '^"cuckoo"' /proc/modules >/dev/null 2>/dev/null
   if [ $? -eq 0 ]; then
     stat_busy "Removing \"cuckoo\" module"
     rmmod \"cuckoo\"
   fi
   if [ "${msg_lang}" = "cn" ]; then
   	stat_busy "正在关闭 OSS 开源驱动"
   else
   	stat_busy "Stopping OSS/Open source driver"
   fi
   /usr/sbin/soundoff
   if [ $? -gt 0 ]; then
     stat_fail
   else
     rm_daemon oss4
     stat_done
   fi
   ;;
 restart)
   $0 stop
   sleep 1
   $0 start
   ;;
 *)
   echo "usage: $0 {start|stop|restart}"
esac