diff options
author | jlam <jlam@pkgsrc.org> | 2002-10-02 21:06:53 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2002-10-02 21:06:53 +0000 |
commit | b8ce6fd21e609d22c41fb688665094cd88996128 (patch) | |
tree | 214fe57f5dae37bbc0133b2a6150b5fbce35f7f9 /audio/oss/files | |
parent | 40a656268eec0c447b92275566de7036d30a7a90 (diff) | |
download | pkgsrc-b8ce6fd21e609d22c41fb688665094cd88996128.tar.gz |
* Move sound{on,off,conf} to ${PREFIX}/sbin.
* Make the oss rc.d script smarter: check that soundconf has been run
before starting, and check that the OSS LKM is loaded before unloading
it when stopping.
* Ensure the OSS LKM is unloaded before deinstalling.
Diffstat (limited to 'audio/oss/files')
-rw-r--r-- | audio/oss/files/oss.sh | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/audio/oss/files/oss.sh b/audio/oss/files/oss.sh index 31ae0be8218..f423dad3bcf 100644 --- a/audio/oss/files/oss.sh +++ b/audio/oss/files/oss.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: oss.sh,v 1.2 2002/10/02 20:46:46 jlam Exp $ +# $NetBSD: oss.sh,v 1.3 2002/10/02 21:06:55 jlam Exp $ # # PROVIDE: oss # REQUIRE: aftermountlkm @@ -12,23 +12,31 @@ fi name="oss" rcvar=$name -required_files="/etc/oss.conf" +required_files="/etc/oss.conf @OSSLIBDIR@/devices.cfg" start_cmd="oss_start" stop_cmd="oss_stop" oss_start() { - if [ -x @PREFIX@/bin/soundon ]; then + missing_files= + for file in ${required_files}; do + if [ ! -f "${file}" ]; then + missing_files="${missing_files} ${file}" + fi + done + if [ -z "${missing_files}" -a -x @PREFIX@/sbin/soundon ]; then @ECHO@ "Starting ${name}." - @PREFIX@/bin/soundon + @PREFIX@/sbin/soundon fi } oss_stop() { - if [ -x @PREFIX@/bin/soundoff ]; then - @ECHO@ "Stopping ${name}." - @PREFIX@/bin/soundoff + if modstat -n oss >/dev/null; then + if [ -x @PREFIX@/sbin/soundoff ]; then + @ECHO@ "Stopping ${name}." + @PREFIX@/sbin/soundoff + fi fi } |