From 544216946bfd693b7b27817dc9eef1f821864ef8 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Sun, 2 Aug 2020 18:36:13 +0200 Subject: [PATCH] fixed profile folder loop --- salt/states/files/install_firefox_addon | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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"