mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-25 00:30:29 +00:00
add a bunch of quotes
This commit is contained in:
parent
7ae700c635
commit
a12f808516
4 changed files with 31 additions and 33 deletions
|
@ -50,8 +50,8 @@ HandleOther(){
|
|||
|
||||
PopBlacklistFile(){
|
||||
#check blacklist file exists, and if not, create it
|
||||
if [[ ! -f ${blacklistFile} ]];then
|
||||
touch ${blacklistFile}
|
||||
if [[ ! -f "${blacklistFile"} ]];then
|
||||
touch "${blacklistFile}"
|
||||
fi
|
||||
for dom in "${domList[@]}"; do
|
||||
if "$addmode"; then
|
||||
|
@ -65,13 +65,13 @@ PopBlacklistFile(){
|
|||
AddDomain(){
|
||||
#| sed 's/\./\\./g'
|
||||
bool=false
|
||||
grep -Ex -q "$1" ${blacklistFile} || bool=true
|
||||
grep -Ex -q "$1" "${blacklistFile}" || bool=true
|
||||
if ${bool}; then
|
||||
#domain not found in the blacklist file, add it!
|
||||
if ${verbose}; then
|
||||
echo -n "::: Adding $1 to blacklist file..."
|
||||
fi
|
||||
echo "$1" >> ${blacklistFile}
|
||||
echo "$1" >> "${blacklistFile}"
|
||||
echo " done!"
|
||||
else
|
||||
if ${verbose}; then
|
||||
|
@ -83,7 +83,7 @@ AddDomain(){
|
|||
RemoveDomain(){
|
||||
|
||||
bool=false
|
||||
grep -Ex -q "$1" ${blacklistFile} || bool=true
|
||||
grep -Ex -q "$1" "${blacklistFile"} || bool=true
|
||||
if ${bool}; then
|
||||
#Domain is not in the blacklist file, no need to Remove
|
||||
if ${verbose}; then
|
||||
|
@ -94,7 +94,7 @@ RemoveDomain(){
|
|||
if ${verbose}; then
|
||||
echo "::: Un-blacklisting $dom..."
|
||||
fi
|
||||
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklistFile}
|
||||
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' "${blacklistFile}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -50,8 +50,8 @@ HandleOther(){
|
|||
|
||||
PopWhitelistFile(){
|
||||
#check whitelist file exists, and if not, create it
|
||||
if [[ ! -f ${whitelistFile} ]];then
|
||||
touch ${whitelistFile}
|
||||
if [[ ! -f "${whitelistFile}" ]];then
|
||||
touch "${whitelistFile}"
|
||||
fi
|
||||
for dom in "${domList[@]}"
|
||||
do
|
||||
|
@ -67,13 +67,13 @@ AddDomain(){
|
|||
#| sed 's/\./\\./g'
|
||||
bool=false
|
||||
|
||||
grep -Ex -q "$1" ${whitelistFile} || bool=true
|
||||
grep -Ex -q "$1" "${whitelistFile}" || bool=true
|
||||
if ${bool}; then
|
||||
#domain not found in the whitelist file, add it!
|
||||
if ${verbose}; then
|
||||
echo -n "::: Adding $1 to $whitelist..."
|
||||
fi
|
||||
echo "$1" >> ${whitelistFile}
|
||||
echo "$1" >> "${whitelistFile}"
|
||||
if ${verbose}; then
|
||||
echo " done!"
|
||||
fi
|
||||
|
@ -87,14 +87,14 @@ AddDomain(){
|
|||
RemoveDomain(){
|
||||
|
||||
bool=false
|
||||
grep -Ex -q "$1" ${whitelistFile} || bool=true
|
||||
grep -Ex -q "$1" "${whitelistFile}" || bool=true
|
||||
if ${bool}; then
|
||||
#Domain is not in the whitelist file, no need to Remove
|
||||
if ${verbose}; then
|
||||
echo "::: $1 is NOT whitelisted! No need to remove"
|
||||
fi
|
||||
else
|
||||
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelistFile}
|
||||
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' "${whitelistFile}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue