combine states

This commit is contained in:
Keiran Snowden
2023-11-26 23:20:04 -05:00
parent 3de878dd20
commit c1a5c8d95b
4 changed files with 13 additions and 20 deletions

18
restic/files/install.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
{% set arch = 'arm' salt.grains.get(cpuarch).startswith('arm') else 'amd64' %}
if test -z "$RESTIC_VERSION"; then
echo "RESTIC_VERSION is not defined"
exit 1
fi
URL="https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_{{ arch }}.bz2"
wget --quiet "${URL}" -O - | bzip2 -cd > /bin/restic.tmp
if [ $? -eq 0 ]; then
chmod +x /bin/restic.tmp
mv /bin/restic.tmp /bin/restic
else
rm -f /bin/restic.tmp
exit 1
fi