From: Chris Koeritz Date: Tue, 24 Jul 2012 02:33:09 +0000 (-0400) Subject: made the sound cycle slower so the script is less annoying when disconnected. X-Git-Tag: 2.140.90~1281 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=f973875db4fdaaa8a91452cf546b7cf7661a37d3;p=feisty_meow.git made the sound cycle slower so the script is less annoying when disconnected. --- diff --git a/scripts/security/start_tunnels.sh b/scripts/security/start_tunnels.sh index 57c8255b..8d159064 100644 --- a/scripts/security/start_tunnels.sh +++ b/scripts/security/start_tunnels.sh @@ -42,14 +42,32 @@ SECURITY_KEY="-i $HOME/.ssh/id_dsa_fred" ############## +# how often to play sounds when reconnecting. +NOISE_PERIOD=60 + +# when we last played a sound. +LAST_SOUND_TIME=0 + +play_sound_periodically() +{ + CURRENT_TIME=$(date +"%s") + if (( $CURRENT_TIME - $LAST_SOUND_TIME >= $NOISE_PERIOD )); then + echo playing sound now. + bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh $soundfile &>/dev/null /dev/null