Если USB-устройство перечислено как звуковая карта в системе, можно хотеть проверить man amixer
и используйте unmute
параметр.
amixer -c 1 set Master playback 100% unmute
Проверьте также другие каналы (PCM и т.д.). Примеры из руководства:
amixer -c 1 sset Line,0 80%,40% unmute cap
will set the second soundcard's left line input volume to 80% and right line
input to 40%, unmute it, and select it as a source for capture (recording).
amixer -c 1 -- sset Master playback -20dB
will set the master volume of the second card to -20dB. If the master has
multiple channels, all channels are set to the same value.
amixer -c 1 set PCM 2dB+
will increase the PCM volume of the second card with 2dB. When both play‐
back and capture volumes exist, this is applied to both volumes.
amixer -c 2 cset iface=MIXER,name='Line Playback Volume",index=1 40%
will set the third soundcard's second line playback volume(s) to 40%
amixer -c 2 cset numid=34 40%
will set the 34th soundcard element to 40%
{ touch /tmp/sleep.flag; sleep 2d ; rm /tmp/sleep.flag; find /home/disk1/ -exec touch {} \; ; } &
Все, что вам нужно просто проверить /tmp/sleep.flag
Наличие файла
[ -f /tmp/sleep.flag ] && echo "Running sleep..."
Попробуйте использовать PS
Искать команду сна:
{ sleep 20; find ...; } &
parent=$!
if ps --ppid $parent | grep sleep
then
echo Sleep is running
fi