From b199f03f8365fbdb7e4207d7f3fccc1b2124988f Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Sat, 3 Jan 2026 21:50:43 -0500 Subject: [PATCH] Add --reboot flag to sanitize script for full automation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skips all prompts when passed, auto-reboots (soft reset) or auto-shutdowns (full sanitize) when complete. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- rpi/sanitize-for-image.sh | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/rpi/sanitize-for-image.sh b/rpi/sanitize-for-image.sh index b1322d5..e98b1e7 100755 --- a/rpi/sanitize-for-image.sh +++ b/rpi/sanitize-for-image.sh @@ -13,8 +13,10 @@ # - Stegasoo auth database (users will create their own admin) # # Usage: -# sudo ./sanitize-for-image.sh # Full sanitize for image distribution -# sudo ./sanitize-for-image.sh --soft # Soft reset (keeps WiFi for testing) +# sudo ./sanitize-for-image.sh # Full sanitize for image distribution +# sudo ./sanitize-for-image.sh --soft # Soft reset (keeps WiFi for testing) +# sudo ./sanitize-for-image.sh --soft --reboot # Soft reset and auto-reboot +# sudo ./sanitize-for-image.sh --reboot # Full sanitize and auto-shutdown # set -e @@ -28,9 +30,13 @@ BOLD='\033[1m' NC='\033[0m' SOFT_RESET=false -if [ "$1" = "--soft" ] || [ "$1" = "-s" ]; then - SOFT_RESET=true -fi +AUTO_REBOOT=false +for arg in "$@"; do + case $arg in + --soft|-s) SOFT_RESET=true ;; + --reboot|-r) AUTO_REBOOT=true ;; + esac +done if [ "$EUID" -ne 0 ]; then echo -e "${RED}Error: Must run as root (sudo)${NC}" @@ -71,11 +77,13 @@ else fi echo "" -read -p "Continue? This cannot be undone! [y/N] " -n 1 -r