Created
June 26, 2022 00:33
-
-
Save kolobus/d0971477b94ba83c8248843d08dfe75e to your computer and use it in GitHub Desktop.
Fetch new IP and cache it to shared memory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f "/dev/shm/node-ip" ]; then | |
curl -s4 checkip.amazonaws.com > /dev/shm/node-ip | |
echo "*********** IP renewed *************" | |
fi | |
nn_ipaddress=$(cat /dev/shm/node-ip) | |
echo $nn_ipaddress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment