Skip to content

Commit c21bc2d

Browse files
juehvscottleibrand
authored andcommitted
Create a status file when public ip found (#1314)
I want to share the online status with other services (for now with my menu script, but Logger could use ist too).
1 parent da535bf commit c21bc2d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bin/oref0-online.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,11 @@ function check_ip {
137137
PUBLIC_IP=$(curl --compressed -4 -s -m 15 checkip.amazonaws.com | awk -F '[, ]' '{print $NF}' | egrep "^[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]$")
138138
if [[ -z $PUBLIC_IP ]]; then
139139
echo not found
140+
rm /tmp/hasPublicIp 2> /dev/null
140141
return 1
141142
else
142143
echo $PUBLIC_IP
144+
touch /tmp/hasPublicIp
143145
fi
144146
}
145147

0 commit comments

Comments
 (0)