summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2004-08-05 14:33:56 +0000
committerTakashi Iwai <tiwai@suse.de>2004-08-05 14:33:56 +0000
commit91bac61d8396360e03b58c0667b3a5e03c0d6449 (patch)
tree40db351152c3a0f8ca2c4dd7b4dac5286c0ca5bc
parent59bf7f2c3411980f96a7c4f0d0b43241b3c2d3b5 (diff)
downloadalsa-utils-91bac61d8396360e03b58c0667b3a5e03c0d6449.tar.gz
Added -c option to specify the module config file.
-rw-r--r--alsaconf/alsaconf.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/alsaconf/alsaconf.in b/alsaconf/alsaconf.in
index f6818ed..3a1dd87 100644
--- a/alsaconf/alsaconf.in
+++ b/alsaconf/alsaconf.in
@@ -63,11 +63,12 @@ usage() {
echo " -p|--probe card-name"
echo " probe a legacy non-isapnp card and print module options"
echo " -P|--listprobe list the supported legacy card modules"
+ echo " -c|--config specify the module config file"
echo " -h|--help what you're reading"
exit 1
}
-OPTS=`getopt -o lmLhp:Pu:g:d:rs: --long legacy,modinfo,log,help,probe,listprobe,uid,gid,devmode,strict,sound -n alsaconf -- "$@"` || exit 1
+OPTS=`getopt -o lmLhp:Pu:g:d:rs:c: --long legacy,modinfo,log,help,probe,listprobe,uid,gid,devmode,strict,sound,config -n alsaconf -- "$@"` || exit 1
eval set -- "$OPTS"
do_legacy_only=0
@@ -108,6 +109,8 @@ while true ; do
alsa_mode="$2"; shift 2;;
-r|--strict)
alsa_uid=0; alsa_gid=17; alsa_mode=0660; shift;;
+ -c|--config)
+ cfgfile="$2"; shift 2;;
--) shift ; break ;;
*) usage ; exit 1 ;;
esac
@@ -155,6 +158,12 @@ esac
# cfgfile = base config file to remove/update the sound setting
# cfgout = new config file to write the sound setting (if different from $cfgfile)
+if [ -n "$cfgfile" ]; then
+ if [ ! -r "$cfgfile" ]; then
+ echo "ERROR: The config file $cfgfile doesn't exist."
+ exit 1
+ fi
+else
if [ "$distribution" = "gentoo" ]; then
cfgfile="/etc/modules.d/alsa"
elif [ "$kernel" = "new" ]; then
@@ -175,6 +184,7 @@ else
cfgfile="/etc/modules.conf"
touch /etc/modules.conf
fi
+fi
# Check for dialog, whiptail, gdialog, awk, ... ?
if which dialog > /dev/null; then