mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-22 07:10:19 +00:00
Remove the email function (#4870)
- **What does this PR aim to accomplish?:** We offered to set an administrator email which was shown on the blockpage. With the removal of the blockpage (https://github.com/pi-hole/pi-hole/pull/3910) this function is not needed anymore. Corresponding web interface PR: https://github.com/pi-hole/AdminLTE/pull/2301
This commit is contained in:
commit
66eeee5548
4 changed files with 2 additions and 40 deletions
|
@ -46,7 +46,6 @@ Options:
|
|||
-c, celsius Set Celsius as preferred temperature unit
|
||||
-f, fahrenheit Set Fahrenheit as preferred temperature unit
|
||||
-k, kelvin Set Kelvin as preferred temperature unit
|
||||
-e, email Set an administrative contact address for the Block Page
|
||||
-h, --help Show this help dialog
|
||||
-i, interface Specify dnsmasq's interface listening behavior
|
||||
-l, privacylevel Set privacy level (0 = lowest, 3 = highest)
|
||||
|
@ -568,37 +567,6 @@ RemoveDHCPStaticAddress() {
|
|||
|
||||
}
|
||||
|
||||
SetAdminEmail() {
|
||||
if [[ "${1}" == "-h" ]] || [[ "${1}" == "--help" ]]; then
|
||||
echo "Usage: pihole -a email <address>
|
||||
Example: 'pihole -a email admin@address.com'
|
||||
Set an administrative contact address for the Block Page
|
||||
|
||||
Options:
|
||||
\"\" Empty: Remove admin contact
|
||||
-h, --help Show this help dialog"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -n "${args[2]}" ]]; then
|
||||
|
||||
# Sanitize email address in case of security issues
|
||||
# Regex from https://stackoverflow.com/a/2138832/4065967
|
||||
local regex
|
||||
regex="^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\$"
|
||||
if [[ ! "${args[2]}" =~ ${regex} ]]; then
|
||||
echo -e " ${CROSS} Invalid email address"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
addOrEditKeyValPair "${setupVars}" "ADMIN_EMAIL" "${args[2]}"
|
||||
echo -e " ${TICK} Setting admin contact to ${args[2]}"
|
||||
else
|
||||
addOrEditKeyValPair "${setupVars}" "ADMIN_EMAIL" ""
|
||||
echo -e " ${TICK} Removing admin contact"
|
||||
fi
|
||||
}
|
||||
|
||||
SetListeningMode() {
|
||||
source "${setupVars}"
|
||||
|
||||
|
@ -847,7 +815,6 @@ main() {
|
|||
"-h" | "--help" ) helpFunc;;
|
||||
"addstaticdhcp" ) AddDHCPStaticAddress;;
|
||||
"removestaticdhcp" ) RemoveDHCPStaticAddress;;
|
||||
"-e" | "email" ) SetAdminEmail "$3";;
|
||||
"-i" | "interface" ) SetListeningMode "$@";;
|
||||
"-t" | "teleporter" ) Teleporter;;
|
||||
"adlist" ) CustomizeAdLists;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue