1
0
Files
src/homepage/zeldb.sh

27 lines
609 B
Bash
Raw Normal View History

2021-04-25 21:48:00 -04:00
#!/bin/sh -x
2021-05-10 08:51:22 -04:00
set -e
2021-04-25 21:42:59 -04:00
2022-02-01 09:30:02 -05:00
if ! command -v curl >/dev/null 2>&1; then
printf "This script depends on curl.\n"
exit 64 # sysexits(3) EX_USAGE
2021-04-25 21:42:59 -04:00
fi
2022-08-30 11:40:40 -04:00
ZELDA="https://archive.org/download/cirno_actually_plays_zelda_in_terminal/zelda.wav"
CURL="curl -Ls"
if command -v aplay >/dev/null 2>&1; # ALSA
then $CURL "$ZELDA" | aplay
elif ls /dev/dsp >/dev/null 2>&1; # OSS
then curl -L "$ZELDA" >/dev/dsp
elif command -v audioplay >/dev/null 2>&1; # NetBSD audio(4)
then $CURL "$ZELDA" | audioplay -f -e ulinear -P 16 -s 48000
2021-04-25 21:42:59 -04:00
else
printf "Unknown sound device. Sorry!\n"
exit 70 # sysexits(3) EX_SOFTWARE
2021-04-25 21:42:59 -04:00
fi
2021-05-10 08:51:22 -04:00
exit 0