mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Set domain name via Settings page
This commit is contained in:
parent
1556adb678
commit
ba015c1918
1 changed files with 33 additions and 17 deletions
|
@ -172,8 +172,23 @@ SetWebUILayout(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for var in "$@"; do
|
SetDNSDomainName(){
|
||||||
case "${var}" in
|
|
||||||
|
# Remove setting from file (create backup setupVars.conf.bak)
|
||||||
|
sed -i.bak '/PIHOLE_DOMAIN/d;' /etc/pihole/setupVars.conf
|
||||||
|
# Save setting to file
|
||||||
|
echo "PIHOLE_DOMAIN=${args[2]}" >> /etc/pihole/setupVars.conf
|
||||||
|
|
||||||
|
# Replace within actual dnsmasq config file
|
||||||
|
sed -i '/domain=/d;' /etc/dnsmasq.d/01-pihole.conf
|
||||||
|
echo "domain=${args[2]}" >> /etc/dnsmasq.d/01-pihole.conf
|
||||||
|
|
||||||
|
# Restart dnsmasq to load new configuration
|
||||||
|
RestartDNS
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
case "${args[1]}" in
|
||||||
"-p" | "password" ) SetWebPassword;;
|
"-p" | "password" ) SetWebPassword;;
|
||||||
"-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
|
"-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
|
||||||
"-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
|
"-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
|
||||||
|
@ -187,8 +202,9 @@ for var in "$@"; do
|
||||||
"disabledhcp" ) DisableDHCP;;
|
"disabledhcp" ) DisableDHCP;;
|
||||||
"layout" ) SetWebUILayout;;
|
"layout" ) SetWebUILayout;;
|
||||||
"-h" | "--help" ) helpFunc;;
|
"-h" | "--help" ) helpFunc;;
|
||||||
esac
|
"domainname" ) SetDNSDomainName;;
|
||||||
done
|
* ) helpFunc;;
|
||||||
|
esac
|
||||||
|
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue