mplayer가 라디오 방송국을 로드할 수 없을 때 오류를 반환하도록 하기

mplayer가 라디오 방송국을 로드할 수 없을 때 오류를 반환하도록 하기

저는 mplayer를 사용하여 라즈베리 파이로 인터넷 라디오 알람시계를 만들고 있습니다. 작동하는 URL이 주어지면 설정이 작동하지만 깨진 URL이 주어지면 오류 코드 없이 '성공적으로' 종료됩니다. 나를 깨우려면 이 시계가 필요합니다. 따라서 하나의 URL이 작동하지 않으면 bash 스크립트가 다음 URL을 시도할 수 있도록 오류 코드를 반환하기를 원합니다. 이것은 작동하지 않는 URL에 대한 출력입니다."https://fake.com".

pi@raspberrypi:~ $ mplayer https://fake.com || echo "failed"
MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/home/pi/.mplayer/input.conf': No such file or directory
Failed to open /home/pi/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.
Playing https://fake.com.
No stream found to handle url https://fake.com
Exiting... (End of file)

실패한 명령을 에코하지 않습니다. 이 문제를 어떻게 바로잡을 수 있나요?

관련 정보