fixed profile folder loop

This commit is contained in:
Jonas Forsberg 2020-08-02 18:36:13 +02:00
parent 8382e25c7b
commit 544216946b
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9

View File

@ -4,11 +4,12 @@ filename="$1"
url="$2" url="$2"
tmpfile=$(mktemp /tmp/install_firefox_addon.XXXXXX) tmpfile=$(mktemp /tmp/install_firefox_addon.XXXXXX)
readarray -t profiles <<<"$(sed -n 's/^Path=\(.*\)$/\1/p' $HOME/.mozilla/firefox/profiles.ini)"
curl -sLo "$tmpfile" "$url" curl -sLo "$tmpfile" "$url"
for p in "$(sed -n 's/^Path=\(.*\)$/\1/p' $HOME/.mozilla/firefox/profiles.ini)";do for p in "$profiles";do
p=${p//[$'\t\r\n']}
cp "$tmpfile" "$HOME/.mozilla/firefox/$p/$filename" cp "$tmpfile" "$HOME/.mozilla/firefox/$p/$filename"
done done
rm "$tmpfile" rm "$tmpfile"