alsactl: revert back old systemd static units with the /etc/alsa/state-daemon.conf...
[alsa-utils.git] / alsactl / 90-alsa-restore.rules.in
index fe0e1ed..3ce9a65 100644 (file)
@@ -1,2 +1,8 @@
-ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS=="card*", \
-        RUN+="@sbindir@/alsactl nrestore $attr{number}"
+ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", GOTO="alsa_restore_go"
+GOTO="alsa_restore_end"
+
+LABEL="alsa_restore_go"
+TEST!="/etc/alsa/state-daemon.conf", RUN+="@sbindir@/alsactl restore $attr{number}"
+TEST=="/etc/alsa/state-daemon.conf", RUN+="@sbindir@/alsactl nrestore $attr{number}"
+
+LABEL="alsa_restore_end"