diff --git a/module/bindhosts.sh b/module/bindhosts.sh index c66a4b0..675b5d2 100644 --- a/module/bindhosts.sh +++ b/module/bindhosts.sh @@ -162,8 +162,8 @@ adblock() { for i in $(sed '/#/d' $PERSISTENT_DIR/whitelist.txt); do echo "0.0.0.0 $i" ; done >> $folder/tempwhitelist # sed strip out everything with #, double space to single space, replace all 127.0.0.1 to 0.0.0.0 # then sort uniq, then grep out whitelist.txt from it - sed -i '/#/d; s/ / /g; /^$/d; s/127.0.0.1/0.0.0.0/' $folder/temphosts - sort_cmd "$folder/temphosts" | grep -Fxvf $folder/tempwhitelist | busybox dos2unix >> $target_hostsfile + sed -i '/#/d; s/ / /g; /^$/d; s/\r$//; s/127.0.0.1/0.0.0.0/' $folder/temphosts + sort_cmd "$folder/temphosts" | grep -Fxvf $folder/tempwhitelist >> $target_hostsfile # mark it, will be read by service.sh to deduce echo "# bindhosts v$versionCode" >> $target_hostsfile }