blob: b6ef3d0ae4c76368e60c7c0ecb766b0de5a6d38a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/usr/bin/env sh
# a simple beep implementation for the "Hinweiston nach 1 TR 110-1, Kap. 8.8", also called "Sonderinformationston" or - shorthand - SIT.
# if you cannot beep :-), here's a hint or two:
# udev pcspkr beep rules: [...] GROUP="beep" MODE="0620", then rmmod, insmod and a udevadm control --reload
function zuhuelf {
printf "USAGE: %b [ -l ]\\n\\n" "$(basename "$0")"
printf "DESCRIPTION: Hinweiston nach 1 TR 110-1, Kap. 8.8 / SonderInformationsTon\\n\\n"
(
printf -- "-h:;This help\\n"
printf -- "-l:;Loop the tone. Delays between loops are also implemented according to\\n"
printf " ;1 TR 110-1 Kap. 8.8.\\n"
)|column -ts\;
printf "\\n"
}
LOOPADOOP=0
while getopts :hl SHOPT;do
case "$SHOPT" in
"h") zuhuelf;exit 0;;
"l") LOOPADOOP=1;;
esac
done
function sittone {
# chain the tones to avoid kernel delays between tones
beep -l 330 -f 950 -n -l 330 -f 1400 -n -l 330 -f 1800
}
if [ "$LOOPADOOP" -eq 1 ];then
# TR 110-1 specifies a delay of 1000ms between repetitions
while true; do sittone; sleep 1; done
else
sittone
fi
|