16 lines
484 B
Bash
Executable File
16 lines
484 B
Bash
Executable File
#!/bin/bash
|
|
set -aeo pipefail
|
|
|
|
{% 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 /tmp/{{ args['name'] }} {{ args['url'] }}
|
|
firefox /tmp/{{ args['name'] }}
|
|
rm /tmp/{{ args['name'] }}
|
|
fi
|
|
{% endfor %}
|
|
|
|
rm "$tmpfile"
|