#!/usr/bin/env bash

docker run --rm -e DFLT_PASSWORD=$DFLT_PASSWORD -e DFLT_USERNAME=$DFLT_USERNAME -e PASSWORD=$PASSWORD -e USERNAME=$USERNAME -v /home/johnp/scsd-configs/git:/repo -v /home/johnp/scsd-configs/git/code:/work -v /home/johnp/scsd-configs/git/configs/:/configs  --privileged -t scsdansible:aug2025 ./run_backup_configs.sh  2>/tmp/run_backups.2.txt >/tmp/run_backups.1.txt
docker run --rm -e DFLT_PASSWORD=$DFLT_PASSWORD -e DFLT_USERNAME=$DFLT_USERNAME -e PASSWORD=$PASSWORD -e USERNAME=$USERNAME -v /home/johnp/scsd-configs/git:/repo -v /home/johnp/scsd-configs/git/code:/work -v /home/johnp/scsd-configs/git/configs/:/configs  --privileged -t scsdansible ./run_backup_configs-cisco.sh   2>/tmp/run_cisco_backups.2.txt >/tmp/run_cisco_backups.1.txt
docker run --rm -e WLC_PASSWORD=$WLC_PASSWORD -e DFLT_PASSWORD=$DFLT_PASSWORD -e DFLT_USERNAME=$DFLT_USERNAME -e PASSWORD=$PASSWORD -e USERNAME=$USERNAME -v /home/johnp/scsd-configs/git:/repo -v /home/johnp/scsd-configs/git/code:/work -v /home/johnp/scsd-configs/git/configs/:/configs  --privileged -t scsdansible:pyexpect ./run_backup_wlcs.sh   2>/tmp/run_wlc_backups.2.txt >/tmp/run_wlc_backups.1.txt
sed -i -E 's/(key|ipsec|wpa-passphrase|password) ([a-f0-9]+) $/ \1 *redacted*/' /home/johnp/scsd-configs/git/configs/wlc/wlc*cfg
docker run --rm -e FG_USERNAME=$FG_USERNAME -e FG_PASSWORD=$FG_PASSWORD -e DFLT_PASSWORD=$DFLT_PASSWORD -e DFLT_USERNAME=$DFLT_USERNAME -e PASSWORD=$PASSWORD -e USERNAME=$USERNAME -v /home/johnp/scsd-configs/git:/repo -v /home/johnp/scsd-configs/git/code:/work -v /home/johnp/scsd-configs/git/configs/:/configs  --privileged -t scsdansible:oct2025 ./run_backup_fortigate.sh   2>/tmp/run_fortigate.2.txt >/tmp/run_fortigate.1.txt

/home/johnp/scsd-configs/git/code/run_git.sh 2>/tmp/run_git.2.txt >/tmp/run_git.1.txt
