mirror of
https://codeberg.org/polyteknisk-radiogruppe/the_prg_server_configuration.git
synced 2026-06-14 02:38:58 +02:00
Fix broken bash script value edge-case
This commit is contained in:
parent
d8d7e721a1
commit
44a32b9c9f
1 changed files with 5 additions and 2 deletions
|
|
@ -614,8 +614,11 @@ in {
|
||||||
)
|
)
|
||||||
|
|
||||||
# Try all the ip services for a valid IPv4 address
|
# Try all the ip services for a valid IPv4 address
|
||||||
for service in $${IP_SERVICES[@]}; do
|
for service in "$${IP_SERVICES[@]}"; do
|
||||||
RAW_IP=$(${pkgs.curl}/bin/curl -s $service)
|
echo "Testing service: $service"
|
||||||
|
RAW_IP=$(curl -s "$service")
|
||||||
|
RAW_IP=$(echo "$RAW_IP" | tr -d '\n' | tr -d '\r' | xargs)
|
||||||
|
echo "RAW_IP: '$RAW_IP'"
|
||||||
if [[ $RAW_IP =~ $REGEX_IPV4 ]]; then
|
if [[ $RAW_IP =~ $REGEX_IPV4 ]]; then
|
||||||
CURRENT_IP=$BASH_REMATCH
|
CURRENT_IP=$BASH_REMATCH
|
||||||
${pkgs.util-linux}/bin/logger -s "DDNS Updater: Fetched IP $CURRENT_IP"
|
${pkgs.util-linux}/bin/logger -s "DDNS Updater: Fetched IP $CURRENT_IP"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue