Update ffproxy.sh
This commit is contained in:
17
ffproxy.sh
17
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 <<EOL > ~/.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
|
||||
|
||||
Reference in New Issue
Block a user