mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Set Pi-Hole state when VPS script start
This commit is contained in:
parent
a78da33f37
commit
403488eb53
1 changed files with 15 additions and 0 deletions
|
@ -171,6 +171,21 @@ _get_vps_config() {
|
|||
_set_config_from_vps
|
||||
fi
|
||||
|
||||
piholeomr="$(uci -q get openmptcprouter.${servername}.pihole)"
|
||||
pihole="$(echo "$vps_config" | jsonfilter -q -e '@.pihole.state')"
|
||||
if [ "$pihole" = "true" ] && [ "$piholeomr" != "1" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set openmptcprouter.${servername}.pihole='1'
|
||||
commit openmptcprouter
|
||||
EOF
|
||||
elif [ "$pihole" = "false" ] && [ "$piholeomr" != "0" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set openmptcprouter.${servername}.pihole='0'
|
||||
commit openmptcprouter
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
vps_kernel="$(echo "$vps_config" | jsonfilter -q -e '@.vps.kernel')"
|
||||
vps_machine="$(echo "$vps_config" | jsonfilter -q -e '@.vps.machine')"
|
||||
vps_omr_version="$(echo "$vps_config" | jsonfilter -q -e '@.vps.omr_version')"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue