]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Added -c option to specify the module config file.
authorTakashi Iwai <tiwai@suse.de>
Thu, 5 Aug 2004 14:33:56 +0000 (14:33 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 5 Aug 2004 14:33:56 +0000 (14:33 +0000)
alsaconf/alsaconf.in

index f6818ed01f37bf1f299042e10e819a2dc0b25feb..3a1dd87bf00493d696a1209bb2ae037733a92e18 100644 (file)
@@ -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