More work on gettings things working.
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
stateDir="${STORMUX_ALSA_STATE_DIR:-/home/stormux/.local/state/alsa}"
|
||||
stateFile="${stateDir}/asound.state"
|
||||
action="${1:-}"
|
||||
|
||||
usage() {
|
||||
printf 'Usage: %s restore|store\n' "${0##*/}" >&2
|
||||
}
|
||||
|
||||
case "$action" in
|
||||
restore)
|
||||
if [[ ! -f "$stateFile" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
exec /usr/bin/alsactl -f "$stateFile" restore
|
||||
;;
|
||||
store)
|
||||
install -d -o root -g root -m 755 "$stateDir"
|
||||
exec /usr/bin/alsactl -f "$stateFile" store
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user