Add emergency test, announce time and weather
This commit is contained in:
commit
74c1f77349
20
bin/announce-time
Executable file
20
bin/announce-time
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source pa-lib
|
||||||
|
|
||||||
|
pa-preheat
|
||||||
|
|
||||||
|
pa-announcement
|
||||||
|
|
||||||
|
DATE=`date +"%B %d, %Y"`
|
||||||
|
pa-say "The date is $DATE."
|
||||||
|
|
||||||
|
sleep "0.5"
|
||||||
|
|
||||||
|
TIME=`date +"%l %p and %M minutes"`
|
||||||
|
pa-say "It is $TIME."
|
||||||
|
|
||||||
|
pa-announcement-quick
|
||||||
|
|
||||||
|
pa-shutdown
|
||||||
|
|
24
bin/announce-weather
Executable file
24
bin/announce-weather
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source pa-lib
|
||||||
|
|
||||||
|
WFILE=/tmp/weather
|
||||||
|
LOCATION="BRQ"
|
||||||
|
|
||||||
|
info "Fetching weather report for $LOCATION."
|
||||||
|
weather -q -m $LOCATION > $WFILE
|
||||||
|
|
||||||
|
pa-preheat
|
||||||
|
|
||||||
|
pa-announcement
|
||||||
|
|
||||||
|
pa-say "Here is the latest weather report:"
|
||||||
|
cat $WFILE
|
||||||
|
pa-say -f "$WFILE" -l 80
|
||||||
|
|
||||||
|
pa-say "Have a great day!"
|
||||||
|
|
||||||
|
pa-announcement-quick
|
||||||
|
|
||||||
|
pa-shutdown
|
||||||
|
|
26
bin/emergency-test
Executable file
26
bin/emergency-test
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source pa-lib
|
||||||
|
|
||||||
|
pa-preheat
|
||||||
|
|
||||||
|
pa-announcement-quickest
|
||||||
|
|
||||||
|
pa-say "Test of emergency warning system will begin."
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
emergency-light on
|
||||||
|
pa-say "This is only a test. In the event of an emergency, this emergency warning light would be used to declare an emergency."
|
||||||
|
pa-say "This is only a test."
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
emergency-light off
|
||||||
|
|
||||||
|
pa-say "This was a test of the emergency warning light system. Thank you for your cooperation."
|
||||||
|
|
||||||
|
pa-announcement-quick
|
||||||
|
|
||||||
|
pa-shutdown
|
||||||
|
|
51
bin/pa-lib
Normal file
51
bin/pa-lib
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
export ROOT=`dirname "$DIR"`
|
||||||
|
export SOUNDS=$ROOT/sounds
|
||||||
|
|
||||||
|
export PLAYER=mplayer
|
||||||
|
export SPEAK=espeak-ng
|
||||||
|
|
||||||
|
function info() {
|
||||||
|
echo "[INFO]" $@
|
||||||
|
}
|
||||||
|
|
||||||
|
function play() {
|
||||||
|
$PLAYER $@ > /dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
function pa-preheat() {
|
||||||
|
info "PA Preheating"
|
||||||
|
pa-power off
|
||||||
|
play $SOUNDS/announcement_4-tone_up_quickest.ogg
|
||||||
|
pa-power on
|
||||||
|
info "PA Ready"
|
||||||
|
}
|
||||||
|
|
||||||
|
function pa-shutdown() {
|
||||||
|
info "PA Shutdown"
|
||||||
|
pa-power off
|
||||||
|
}
|
||||||
|
|
||||||
|
function pa-announcement() {
|
||||||
|
info " DING DONG "
|
||||||
|
play $SOUNDS/announcement_4-tone_up_smooth.ogg
|
||||||
|
}
|
||||||
|
|
||||||
|
function pa-announcement-quick() {
|
||||||
|
info " Ding Dong "
|
||||||
|
play $SOUNDS/announcement_4-tone_up_smooth_quick.ogg
|
||||||
|
}
|
||||||
|
|
||||||
|
function pa-announcement-quickest() {
|
||||||
|
info " ding-dong "
|
||||||
|
play $SOUNDS/announcement_4-tone_up_quickest.ogg
|
||||||
|
}
|
||||||
|
|
||||||
|
function pa-say() {
|
||||||
|
info "Say: $@"
|
||||||
|
$SPEAK "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
BIN
sounds/announcement_4-tone_up.ogg
Executable file
BIN
sounds/announcement_4-tone_up.ogg
Executable file
Binary file not shown.
BIN
sounds/announcement_4-tone_up_quickest.ogg
Executable file
BIN
sounds/announcement_4-tone_up_quickest.ogg
Executable file
Binary file not shown.
BIN
sounds/announcement_4-tone_up_smooth.ogg
Executable file
BIN
sounds/announcement_4-tone_up_smooth.ogg
Executable file
Binary file not shown.
BIN
sounds/announcement_4-tone_up_smooth_quick.ogg
Executable file
BIN
sounds/announcement_4-tone_up_smooth_quick.ogg
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user