- unblock using hosts.ORIGNAL might not always give the desired result as user could have changed hostname, without adjusting hosts.ORIGINAL, which could later results in further issues.
Yes , a better way to unblock would be to remove all lines between $markerstart and $markerend . This keeps all modifications done by the user but removes all modifications done by antiX advert blocker .
To fix this , in function download_blocklist ,
Code: Select all
mv -f "/etc/hosts.ORIGINAL" "/etc/hosts"
rm -f "/etc/hosts.saved"
could be replaced with
Code: Select all
# Remove everything between markers to unblock everything
sed -i -e "/$markerstart/,/$markerend/d" /etc/hosts
#remove the markers
sed -i -e "/$markerstart/d" /etc/hosts
sed -i -e "/$markerend/d" /etc/hosts
rm -f "/etc/hosts.saved"