Set domain name via Settings page

This commit is contained in:
DL6ER 2016-12-14 14:24:09 +01:00
parent 1556adb678
commit ba015c1918

View file

@ -172,23 +172,39 @@ SetWebUILayout(){
} }
for var in "$@"; do SetDNSDomainName(){
case "${var}" in
"-p" | "password" ) SetWebPassword;; # Remove setting from file (create backup setupVars.conf.bak)
"-c" | "celsius" ) unit="C"; SetTemperatureUnit;; sed -i.bak '/PIHOLE_DOMAIN/d;' /etc/pihole/setupVars.conf
"-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;; # Save setting to file
"setdns" ) SetDNSServers;; echo "PIHOLE_DOMAIN=${args[2]}" >> /etc/pihole/setupVars.conf
"setexcludedomains" ) SetExcludeDomains;;
"setexcludeclients" ) SetExcludeClients;; # Replace within actual dnsmasq config file
"reboot" ) Reboot;; sed -i '/domain=/d;' /etc/dnsmasq.d/01-pihole.conf
"restartdns" ) RestartDNS;; echo "domain=${args[2]}" >> /etc/dnsmasq.d/01-pihole.conf
"setquerylog" ) SetQueryLogOptions;;
"enabledhcp" ) EnableDHCP;; # Restart dnsmasq to load new configuration
"disabledhcp" ) DisableDHCP;; RestartDNS
"layout" ) SetWebUILayout;;
"-h" | "--help" ) helpFunc;; }
esac
done case "${args[1]}" in
"-p" | "password" ) SetWebPassword;;
"-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
"-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
"setdns" ) SetDNSServers;;
"setexcludedomains" ) SetExcludeDomains;;
"setexcludeclients" ) SetExcludeClients;;
"reboot" ) Reboot;;
"restartdns" ) RestartDNS;;
"setquerylog" ) SetQueryLogOptions;;
"enabledhcp" ) EnableDHCP;;
"disabledhcp" ) DisableDHCP;;
"layout" ) SetWebUILayout;;
"-h" | "--help" ) helpFunc;;
"domainname" ) SetDNSDomainName;;
* ) helpFunc;;
esac
shift shift