#!/bin/bash # chain2.sh — D22 put-back on two apps, then the re-run list (first-run evidence kept in /first-run/) E=/mnt/5_hdd/felhom.eu/git/felhom.eu/documentation/audits/catalog-sweep-2026-10-24 export SC=/run/user/1000/sweep-sc TARGET=sweep BASE=https://192.168.0.157 DRIVE_ROOT=/mnt/felhom-drives/hdd_1 SWEEP_EV=$E cd $E/tools for a in privatebin vikunja; do echo "$(date -u +%T) START putback $a" >> $E/progress.log timeout 2400 python3 putback.py $a > $E/_putback-$a.console.txt 2>&1 < /dev/null echo "$(date -u +%T) END putback $a rc=$?" >> $E/progress.log done while read -r app; do [ -n "$app" ] || continue if [ -d "$E/$app" ] && [ ! -d "$E/$app/first-run" ]; then mkdir -p "$E/$app/first-run.tmp"; mv "$E/$app"/* "$E/$app/first-run.tmp/" 2>/dev/null; mv "$E/$app/first-run.tmp" "$E/$app/first-run"; fi [ -f "$E/$app.console.txt" ] && mv "$E/$app.console.txt" "$E/$app/first-run/console.txt" echo "$(date -u +%T) START redo $app" >> $E/progress.log timeout 2700 python3 sweep.py "$app" > $E/$app.console.txt 2>&1 < /dev/null echo "$(date -u +%T) END redo $app rc=$?" >> $E/progress.log left=$(ssh -n -o BatchMode=yes root@192.168.0.138 "pct exec 9201 -- sh -c 'ls /opt/docker/stacks/*/app.yaml 2>/dev/null'" 2>/dev/null) [ -n "$left" ] && echo "$(date -u +%T) WARN installed after $app: $left" >> $E/progress.log done < "$E/tools/redo-live.txt" echo "$(date -u +%T) CHAIN2 DONE" >> $E/progress.log