stupid fixes
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
IPS=$(/usr/bin/docker exec -t wireguard curl 10.13.13.1:5000/storage | jq -r '[.[].ip]|join(",")' | sed 's/\n//g')
|
DIRTY_IPS=$(/usr/bin/docker exec -t wireguard curl 10.13.13.1:5000/storage | jq -r '[.[].ip]|join(",")' | sed 's/\n//g')
|
||||||
|
|
||||||
cleaned_ips=$(echo "$IPS" | sed -E 's/[^0-9.,]//g' | sed 's/,,*/,/g' | sed 's/,$//')
|
IPS=$(echo "$DIRTY_IPS" | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | paste -sd "," -)
|
||||||
|
|
||||||
if [ -z "$cleaned_ips" ]; then
|
if [ -z "$IPS" ]; then
|
||||||
echo "whitelist empty"
|
echo "whitelist empty"
|
||||||
else
|
else
|
||||||
sed -i.bak "s/WHITELIST=.*/WHITELIST=${cleaned_ips},192\.168\.0\.0\/16/g" /root/rpc/.env
|
sed -i.bak "s/WHITELIST=.*/WHITELIST=${IPS},192\.168\.0\.0\/16/g" /root/rpc/.env
|
||||||
cd /root/rpc && docker compose up -d traefik
|
cd /root/rpc && docker compose up -d traefik
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user