mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Merge pull request #1465 from pi-hole/busybox_sed_support
Update list.sh for busybox compatibility
This commit is contained in:
commit
db10c8ab46
1 changed files with 4 additions and 4 deletions
|
@ -157,8 +157,8 @@ RemoveDomain() {
|
||||||
if [[ "${bool}" == true ]]; then
|
if [[ "${bool}" == true ]]; then
|
||||||
# Remove it from the other one
|
# Remove it from the other one
|
||||||
echo "::: Removing $1 from $list..."
|
echo "::: Removing $1 from $list..."
|
||||||
# /I flag: search case-insensitive
|
# Busybox sed compatible case-insensitive domain removal
|
||||||
sed -i "/${domain}/Id" "${list}"
|
sed -i "$(grep -in "^${domain}$" ${list} | awk -F':' '{print $1}' | tr '\n' ',' | sed 's/,$/\n/')d" ${list}
|
||||||
reload=true
|
reload=true
|
||||||
else
|
else
|
||||||
if [[ "${verbose}" == true ]]; then
|
if [[ "${verbose}" == true ]]; then
|
||||||
|
@ -174,8 +174,8 @@ RemoveDomain() {
|
||||||
if [[ "${bool}" == true ]]; then
|
if [[ "${bool}" == true ]]; then
|
||||||
# Remove it from the other one
|
# Remove it from the other one
|
||||||
echo "::: Removing $1 from $list..."
|
echo "::: Removing $1 from $list..."
|
||||||
# /I flag: search case-insensitive
|
# Busybox sed compatible case-insensitive domain removal
|
||||||
sed -i "/address=\/${domain}/Id" "${list}"
|
sed -i "$(grep -in "/${domain}/" ${list} | awk -F':' '{print $1}' | tr '\n' ',' | sed 's/,$/\n/')d" ${list}
|
||||||
reload=true
|
reload=true
|
||||||
else
|
else
|
||||||
if [[ "${verbose}" == true ]]; then
|
if [[ "${verbose}" == true ]]; then
|
||||||
|
|
Loading…
Reference in a new issue