mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 03:45:42 +01:00
Added -c option to specify the module config file.
This commit is contained in:
parent
59bf7f2c34
commit
91bac61d83
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue