From 16050bc233225986f8e77fec698657e1ffa4ac31 Mon Sep 17 00:00:00 2001 From: scossa Date: Mon, 18 Aug 2025 15:50:08 +0200 Subject: [PATCH] Update ffproxy.sh --- ffproxy.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ffproxy.sh b/ffproxy.sh index e2fa467..a9ca01f 100644 --- a/ffproxy.sh +++ b/ffproxy.sh @@ -13,14 +13,18 @@ function istruzioni() { echo "-p uBlock Origin preinstallato" } - +# Funzione scarica e installa ublock origin function ublock() { - VERS=$(curl -s "https://api.github.com/repos/gorhill/uBlock/releases/latest" | jq -r .tag_name | sed 's/..$//') + # Se la cartella del profilo sock5$PORT nonn esiste if [ ! -d "/home/$USER/.mozilla/firefox/ffproxy/socks5-$PORT/extensions" ]; then + # Trova la vers attuale e crea la cartella con il nome della porta + VERS=$(curl -s "https://api.github.com/repos/gorhill/uBlock/releases/latest" | jq -r .tag_name | sed 's/..$//') mkdir -p /home/$USER/.mozilla/firefox/ffproxy/socks5-$PORT/extensions - cd /home/$USER/.mozilla/firefox/ffproxy/socks5-$PORT/extensions + + # Scarica ublock Origin wget -q https://github.com/gorhill/uBlock/releases/download/$VERS.1b7/uBlock0_$VERS.1b7.firefox.signed.xpi + # Compila il manifest.json cat < ~/.mozilla/firefox/ffproxy/socks5-$PORT/extensions/manifest.json { "manifest_version": 2, @@ -37,7 +41,7 @@ EOL fi } - +# Mostra Help if [ "$1" = "-h" -o "$1" = "--help" ] then istruzioni @@ -51,7 +55,8 @@ VERS="" incognito_option="" plugin_option="" -# # Crea un nuovo profilo Firefox se non esiste +# Crea un nuovo profilo Firefox se non esiste +if [ ! -d "PROFILE_DIR" ]; then mkdir -p "$PROFILE_DIR" firefox -no-remote -CreateProfile "socks5-$PORT" "$PROFILE_DIR" @@ -62,7 +67,7 @@ plugin_option="" echo 'user_pref("network.proxy.socks", "127.0.0.1");' >> "$PREFS_FILE" echo "user_pref(\"network.proxy.socks_port\", $PORT);" >> "$PREFS_FILE" echo 'user_pref("network.proxy.socks_remote_dns", true);' >> "$PREFS_FILE" - +fi # Check argomenti for arg in "$@"; do