mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +00:00
Update list.sh
I believe this has feature parity with `sed /foo/ Id` but also supports busybox, and my alpine docker ;)
This commit is contained in:
parent
b166410cbf
commit
55f78e3b64
1 changed files with 4 additions and 4 deletions
|
@ -157,8 +157,8 @@ RemoveDomain() {
|
|||
if [[ "${bool}" == true ]]; then
|
||||
# Remove it from the other one
|
||||
echo "::: Removing $1 from $list..."
|
||||
# /I flag: search case-insensitive
|
||||
sed -i "/${domain}/Id" "${list}"
|
||||
# Busybox sed compatible case-insensitive domain removal
|
||||
sed -i "$(grep -in "^${domain}$" ${list} | awk -F':' '{print $1}' | tr '\n' ',' | sed 's/,$/\n/')d" ${list}
|
||||
reload=true
|
||||
else
|
||||
if [[ "${verbose}" == true ]]; then
|
||||
|
@ -174,8 +174,8 @@ RemoveDomain() {
|
|||
if [[ "${bool}" == true ]]; then
|
||||
# Remove it from the other one
|
||||
echo "::: Removing $1 from $list..."
|
||||
# /I flag: search case-insensitive
|
||||
sed -i "/address=\/${domain}/Id" "${list}"
|
||||
# Busybox sed compatible case-insensitive domain removal
|
||||
sed -i "$(grep -in "/${domain}/" ${list} | awk -F':' '{print $1}' | tr '\n' ',' | sed 's/,$/\n/')d" ${list}
|
||||
reload=true
|
||||
else
|
||||
if [[ "${verbose}" == true ]]; then
|
||||
|
|
Loading…
Reference in a new issue