This file contains hidden or 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 | |
# From commit to running globally within a minute! | |
# 1. Build & upload your image | |
# 2. Configure environment variables and more | |
# 3. `deploy.sh` takes care of the rest! | |
# Ensure script receives an argument for container name | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <container_name>" | |
exit 1 |
This file contains hidden or 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 | |
# Try to get IPv4 address and mask from tun0 | |
tun_info=$(ip -4 addr show tun0 2>/dev/null | grep -oP 'inet \K[\d.]+/\d+') | |
# Try to get IPv4 address and mask from eth0 if tun0 fails | |
eth_info=$(ip -4 addr show eth0 2>/dev/null | grep -oP 'inet \K[\d.]+/\d+') | |
# Decide which to display | |
if [[ -n "$tun_info" ]]; then |