Skip to content

Commit e0dd7ac

Browse files
Update useful_scripts/ping_loop.sh & add todo
1 parent be0573a commit e0dd7ac

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

useful_scripts/ping_loop.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# This file is part of eRCaGuy_dotfiles: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles
44

@@ -41,6 +41,8 @@ if [ -z $IP_ADDR ]; then
4141
exit $RETURN_CODE_ERROR
4242
fi
4343

44+
# TODO: WRAP THE STUFF BELOW IN A FUNCTION!
45+
4446
# Capture the Ctrl + C command and specify what to do when it is pressed. This allows us to exit
4547
# the otherwise unexitable infinite while loop by pressing Ctrl + C!
4648
# See [see my comments under this answer too!]: https://serverfault.com/a/105390/357116
@@ -50,7 +52,7 @@ count=0
5052
while true; do
5153
echo "Attempt: $count"
5254
((count++))
53-
ping -c 1 -W 1 "$IP_ADDR"
55+
ping -c 1 -W 2 "$IP_ADDR"
5456

5557
return_code=$?
5658
# Exit if the IP address is alive and responding to the ping, so the return code is 0,

0 commit comments

Comments
 (0)