add in CustomizeAdlists function

This commit is contained in:
Adam Warner 2017-03-31 19:35:52 +01:00
parent 02040cd25d
commit b4bc90fb85
No known key found for this signature in database
GPG key ID: 7C062498C7FA6E49

View file

@ -319,6 +319,22 @@ SetWebUILayout(){
}
CustomizeAdLists() {
list = "/etc/pihole/adlists.list"
if [[ "${args[2]}" == "enable" ]] ; then
sed -i "\\@${args[3]}@s/^#http/http/g" "${list}"
elif [[ "${args[2]}" == "disable" ]] ; then
sed -i "\\@${args[3]}@s/^http/#http/g" "${list}"
elif [[ "${args[2]}" == "add" && "${args[3]}" == "user" ]] ; then
echo "${args[3]}" >> /etc/pihole/adlists.user
else
echo "Not permitted"
return 1
fi
}
SetPrivacyMode(){
if [[ "${args[2]}" == "true" ]] ; then