1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Change DNS when VPS is down and Pi-Hole used

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-08-09 17:20:12 +02:00
parent 3193f4ef70
commit 00ddf7b378
2 changed files with 31 additions and 0 deletions

View file

@ -175,6 +175,15 @@ _get_vps_config() {
vpn="$(uci -q get openmptcprouter.settings.vpn)"
pihole="$(echo "$vps_config" | jsonfilter -q -e '@.pihole.state')"
if [ "$pihole" = "true" ]; then
uci -q batch <<-EOF >/dev/null
set openmptcprouter.${servername}.pihole='1'
EOF
else
uci -q batch <<-EOF >/dev/null
set openmptcprouter.${servername}.pihole='0'
EOF
fi
glorytun_state=0
glorytun_change=0