aping.sh: fix espeak voice option and empty sound file argument

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 14:59:00 -04:00
co-authored by Claude Opus 5.5
parent 3090120ea1
commit 3faa4ae41c
+3 -3
View File
@@ -9,7 +9,7 @@ site="google.com"
#notification settings
sound_player="espeak"
player_opts=("-v en-uk-north")
player_opts=("-v" "en-gb-x-gbclan")
sound_file=""
sound_message="The internet is working!"
popup_box="false"
@@ -41,7 +41,7 @@ withLoop(){
elif [ $ping_result = "0" ];then
if [ "${play_sound}" = "true" ];then
${sound_player} "${player_opts[@]}" ${sound_file} "${sound_message}" &
${sound_player} "${player_opts[@]}" ${sound_file:+"${sound_file}"} "${sound_message}" &
fi
lanip=$(ip -o -4 addr show | awk '$2 != "lo" {sub(/\/.*/, "", $4); print $4}')
@@ -89,7 +89,7 @@ withoutLoop(){
elif [ $ping_result = "0" ];then
if [ "${play_sound}" = "true" ];then
${sound_player} "${player_opts[@]}" "${sound_file}" "${sound_message}" &
${sound_player} "${player_opts[@]}" ${sound_file:+"${sound_file}"} "${sound_message}" &
fi