removed tempfile usage
This commit is contained in:
parent
d5405d7ad4
commit
375922407e
@ -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 %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user