diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-05-03 21:08:42 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-05-03 21:08:42 +0400 |
commit | 1058def8e7827e56ce4a70afb4aeacb5dc44148f (patch) | |
tree | 4495d23e7b54ab5700e3839081e797c1eafe0db9 /setup/SunOS/svc-oss.htm | |
download | oss4-upstream.tar.gz |
Imported Upstream version 4.2-build2006upstream/4.2-build2006upstream
Diffstat (limited to 'setup/SunOS/svc-oss.htm')
-rwxr-xr-x | setup/SunOS/svc-oss.htm | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/setup/SunOS/svc-oss.htm b/setup/SunOS/svc-oss.htm new file mode 100755 index 0000000..d45a124 --- /dev/null +++ b/setup/SunOS/svc-oss.htm @@ -0,0 +1,55 @@ +#!/sbin/sh +# + +. /lib/svc/share/smf_include.sh + +# Generic runtime checks +OSS_SERVICE=`echo $SMF_FMRI | sed 's/.*:\(.*\)/\1/'` + +if [ -z "$SMF_FMRI" ]; then + echo "Open Sound System service can only be started/stopped via the SMF framework" + exit $SMF_EXIT_ERR_NOSMF +fi + +if [ -z "$OSS_SERVICE" ]; then + echo "Unable to parse service name from SMF FRMI $SMF_FRMI" + exit $SMF_EXIT_ERR_NOSMF +fi + +# +# Original script, refactored +# + +if test -f /etc/oss.conf +then + . /etc/oss.conf +else + OSSLIBDIR=/usr/lib/oss +fi + +oss_start() { + /usr/sbin/soundon > /dev/null 2>&1 + # Somehow this is required overhere to prevent skipping + /usr/sbin/ossdevlinks +} + +oss_stop() { + # Save mixer settings automatically if requested + if test -f $OSSLIBDIR/etc/userdefs && /usr/xpg4/bin/grep -q "autosave_mixer yes" $OSSLIBDIR/etc/userdefs + then + /usr/sbin/savemixer + fi +} + +case $1 in +'start') + oss_start + ;; +'stop') + oss_stop + ;; +*) + echo "Usage: $0 { start | stop }" + exit 1 + ;; +esac |