#!/bin/bashKEY=„…“SECRET=„…“HOST="firewall"BKPPATH="/usr/SHARE/BACKUP/OPNsense"#set -x####curl -s -k -u $KEY:$SECRET https://$HOST/api/backup/backup/download -o $BKPPATH/opnsense-config-$(date +%F_%H%M%S).xmlcurl -s -k -u "${KEY}":"${SECRET}" https://${HOST}/api/core/backup/download/this --create-dirs -o $BKPPATH/opnsense-config-$(date +%F_%H%M%S).xml#find $PATH/ -type f -name '*.xml' -mtime +42 -exec rm {} \;#
###curl -s -k -u $KEY:$SECRET https://$HOST/api/backup/backup/download -o $BKPPATH/opnsense-config-$(date +%F_%H%M%S).xmlcurl -s -k -u "${KEY}":"${SECRET}" https://${HOST}/api/core/backup/download/this --create-dirs -o $BKPPATH/opnsense-config-$(date +%F_%H%M%S).xml