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"
|
echo "-p uBlock Origin preinstallato"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Funzione scarica e installa ublock origin
|
||||||
function ublock() {
|
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
|
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
|
mkdir -p /home/$USER/.mozilla/firefox/ffproxy/socks5-$PORT/extensions
|
||||||
|
|
||||||
cd /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
|
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
|
cat <<EOL > ~/.mozilla/firefox/ffproxy/socks5-$PORT/extensions/manifest.json
|
||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
@@ -37,7 +41,7 @@ EOL
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Mostra Help
|
||||||
if [ "$1" = "-h" -o "$1" = "--help" ]
|
if [ "$1" = "-h" -o "$1" = "--help" ]
|
||||||
then
|
then
|
||||||
istruzioni
|
istruzioni
|
||||||
@@ -51,7 +55,8 @@ VERS=""
|
|||||||
incognito_option=""
|
incognito_option=""
|
||||||
plugin_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"
|
mkdir -p "$PROFILE_DIR"
|
||||||
firefox -no-remote -CreateProfile "socks5-$PORT" "$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", "127.0.0.1");' >> "$PREFS_FILE"
|
||||||
echo "user_pref(\"network.proxy.socks_port\", $PORT);" >> "$PREFS_FILE"
|
echo "user_pref(\"network.proxy.socks_port\", $PORT);" >> "$PREFS_FILE"
|
||||||
echo 'user_pref("network.proxy.socks_remote_dns", true);' >> "$PREFS_FILE"
|
echo 'user_pref("network.proxy.socks_remote_dns", true);' >> "$PREFS_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check argomenti
|
# Check argomenti
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
|
|||||||
Reference in New Issue
Block a user