From 375922407e1cba413d74473c195edb2f1902ca94 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Mon, 3 Aug 2020 10:35:16 +0200 Subject: [PATCH] removed tempfile usage --- salt/states/files/install_firefox_addon | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/salt/states/files/install_firefox_addon b/salt/states/files/install_firefox_addon index eb1177d..ebc288f 100755 --- a/salt/states/files/install_firefox_addon +++ b/salt/states/files/install_firefox_addon @@ -1,16 +1,14 @@ #!/bin/bash set -aeo pipefail -filename="$1" -url="$2" -tmpfile=$(mktemp /tmp/install_firefox_addon.XXXXXX.xpi) {% for name, args in pillar['firefox']['addons'].items() %} if [[ $(grep -oP '(?<=\},\"name\":\"){{ name }}' {{ salt['user.info']( pillar['username'] ).home }}/.mozilla/firefox/*.default*/addons.json) ]]; then printf "{{ name }} is already installed\n" else printf "installing {{ name }}\n" - curl -sLo "$tmpfile" {{ args['url'] }} - firefox "$tmpfile" + curl -sLo /tmp/{{ args['name'] }} {{ args['url'] }} + firefox /tmp/{{ args['name'] }} + rm /tmp/{{ args['name'] }} fi {% endfor %}