mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-19 05:40:13 +00:00
add wrappers to utils.sh for setting FTL config & add tests
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
e3ffec5762
commit
632aead691
2 changed files with 78 additions and 0 deletions
|
@ -145,3 +145,26 @@ getFTLPID() {
|
|||
FTL_PID=${FTL_PID:=-1}
|
||||
echo "${FTL_PID}"
|
||||
}
|
||||
|
||||
#######################
|
||||
# returns value from FTLs config file using pihole-FTL --config
|
||||
#
|
||||
# Takes one argument: key
|
||||
# Example getFTLConfigValue dns.piholePTR
|
||||
#######################
|
||||
getFTLConfigValue(){
|
||||
pihole-FTL --config "${1}"
|
||||
}
|
||||
|
||||
#######################
|
||||
# sets value in FTLs config file using pihole-FTL --config
|
||||
#
|
||||
# Takes two arguments: key and value
|
||||
# Example setFTLConfigValue dns.piholePTR PI.HOLE
|
||||
#
|
||||
# Note, for complex values such as dnsmasq.upstreams, you should wrap the value in single quotes:
|
||||
# setFTLConfigValue dnsmasq.upstreams '[ "8.8.8.8" , "8.8.4.4" ]'
|
||||
#######################
|
||||
setFTLConfigValue(){
|
||||
pihole-FTL --config "${1}" "${2}"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue