aboutsummaryrefslogtreecommitdiffstats
path: root/roles/archive_server/files/usr/local/libexec/archiver/archive_opnsense
diff options
context:
space:
mode:
Diffstat (limited to 'roles/archive_server/files/usr/local/libexec/archiver/archive_opnsense')
-rw-r--r--roles/archive_server/files/usr/local/libexec/archiver/archive_opnsense12
1 files changed, 12 insertions, 0 deletions
diff --git a/roles/archive_server/files/usr/local/libexec/archiver/archive_opnsense b/roles/archive_server/files/usr/local/libexec/archiver/archive_opnsense
new file mode 100644
index 0000000..a51a068
--- /dev/null
+++ b/roles/archive_server/files/usr/local/libexec/archiver/archive_opnsense
@@ -0,0 +1,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"