diff --git a/salt/states/files/install_firefox_addon b/salt/states/files/install_firefox_addon index a4082c0..f7179a4 100755 --- a/salt/states/files/install_firefox_addon +++ b/salt/states/files/install_firefox_addon @@ -4,11 +4,12 @@ filename="$1" url="$2" 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" -for p in "$(sed -n 's/^Path=\(.*\)$/\1/p' $HOME/.mozilla/firefox/profiles.ini)";do - p=${p//[$'\t\r\n']} +for p in "$profiles";do cp "$tmpfile" "$HOME/.mozilla/firefox/$p/$filename" done rm "$tmpfile"