To follow on, I don't anticipate the script failing due to /var/lib/alsa or /usr/bin being unavailable. Rather, I suspect alsactl is bugging out, so please also change line 84 from:
if MSG="$(alsactl store $CARD 2>&1)" ; then
to:
if MSG="$(alsactl -d store $CARD)" ; then
(Note the addition of the debugging option and the removal of the stdout and stderr redirection.)
To follow on, I don't anticipate the script failing due to /var/lib/alsa or /usr/bin being unavailable. Rather, I suspect alsactl is bugging out, so please also change line 84 from:
if MSG="$(alsactl store $CARD 2>&1)" ; then
to:
if MSG="$(alsactl -d store $CARD)" ; then
(Note the addition of the debugging option and the removal of the stdout and stderr redirection.)