dotfiles/salt/states/files/install_firefox_addon
2020-08-03 16:17:17 +02:00

12 lines
367 B
Bash
Executable File

#!/bin/bash
set -aeo pipefail
{% for name, url 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"
firefox {{ url }}
fi
{% endfor %}