aboutsummaryrefslogtreecommitdiffstats
path: root/roles/archive_server/files/usr/local/libexec/archiver/archive_opnsense
blob: a51a06872108f5a122e5767d34fe1749b0a16be2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

set -Eeu -o pipefail

HOST=$1
KEY=$2
SECRET=$3

URL=https://${HOST}/api/backup/backup/download
TIMESTAMP=$(date +%Y%m%d%H%M%S)

curl -sSfk -u "${KEY}:${SECRET}" -o "opnsense-${TIMESTAMP}.xml" "$URL"