From bc7db86c70de573df2d46b944a4a93883c15d3fd Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Mon, 21 Aug 2023 11:47:53 +0200 Subject: [PATCH] Remove comments in middle line --- maza | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/maza b/maza index fb59e4f..b22da1c 100755 --- a/maza +++ b/maza @@ -4,7 +4,8 @@ set -e # VARIABLES -URL_DNS_LIST="https://pgl.yoyo.org/adservers/serverlist.php?showintro=0&mimetype=plaintext" +#URL_DNS_LIST="https://pgl.yoyo.org/adservers/serverlist.php?showintro=0&mimetype=plaintext" +URL_DNS_LIST="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" NAME_OSX="Darwin" THIS_OS=$(uname -mrs) PROGNAME=$(basename "$0") @@ -91,7 +92,12 @@ update() { # Download DNS list curl -L -s "$URL_DNS_LIST" -o "$CONFIG$LIST" ## Remove comments + ### Start with # custom-sed -i.bak '/^#/ d' "$CONFIG$LIST" + ### Remove comments in middle of line + custom-sed -i.bak 's/#.*$//g' "$CONFIG$LIST" + ### Remove spaces in end of line + custom-sed -i.bak 's/ *$//g' "$CONFIG$LIST" ## Remove "0.0.0.0" or "127.0.0.1" custom-sed -i.bak 's/0.0.0.0 //g' "$CONFIG$LIST" custom-sed -i.bak 's/127.0.0.1 //g' "$CONFIG$LIST"