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:
@@ -9,7 +9,7 @@ site="google.com"
|
|||||||
|
|
||||||
#notification settings
|
#notification settings
|
||||||
sound_player="espeak"
|
sound_player="espeak"
|
||||||
player_opts=("-v en-uk-north")
|
player_opts=("-v" "en-gb-x-gbclan")
|
||||||
sound_file=""
|
sound_file=""
|
||||||
sound_message="The internet is working!"
|
sound_message="The internet is working!"
|
||||||
popup_box="false"
|
popup_box="false"
|
||||||
@@ -41,7 +41,7 @@ withLoop(){
|
|||||||
|
|
||||||
elif [ $ping_result = "0" ];then
|
elif [ $ping_result = "0" ];then
|
||||||
if [ "${play_sound}" = "true" ];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
|
fi
|
||||||
|
|
||||||
lanip=$(ip -o -4 addr show | awk '$2 != "lo" {sub(/\/.*/, "", $4); print $4}')
|
lanip=$(ip -o -4 addr show | awk '$2 != "lo" {sub(/\/.*/, "", $4); print $4}')
|
||||||
@@ -89,7 +89,7 @@ withoutLoop(){
|
|||||||
elif [ $ping_result = "0" ];then
|
elif [ $ping_result = "0" ];then
|
||||||
|
|
||||||
if [ "${play_sound}" = "true" ];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
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user