From 75b62035250339ccbff950101c12d4011af84da8 Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Sun, 4 Jan 2026 17:03:13 -0500 Subject: [PATCH] Make PATH hook a check/fix step in sanitize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now checks if /etc/profile.d/stegasoo-path.sh exists and creates it if missing, rather than always overwriting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- rpi/sanitize-for-image.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/rpi/sanitize-for-image.sh b/rpi/sanitize-for-image.sh index 8ceae11..aaebac3 100755 --- a/rpi/sanitize-for-image.sh +++ b/rpi/sanitize-for-image.sh @@ -309,13 +309,9 @@ if [ -n "$STEGASOO_DIR" ] && [ -d "$STEGASOO_DIR/venv" ]; then fi fi -if [ -n "$STEGASOO_DIR" ] && [ -f "$STEGASOO_DIR/rpi/stegasoo-wizard.sh" ]; then - # Install the profile.d hook - cp "$STEGASOO_DIR/rpi/stegasoo-wizard.sh" /etc/profile.d/stegasoo-wizard.sh - chmod 644 /etc/profile.d/stegasoo-wizard.sh - echo " Installed wizard hook to /etc/profile.d/" - - # Add stegasoo to PATH for all users +# Ensure PATH hook exists for stegasoo CLI and scripts +if [ ! -f /etc/profile.d/stegasoo-path.sh ]; then + echo " Creating PATH hook..." cat > /etc/profile.d/stegasoo-path.sh <<'PATHEOF' # Stegasoo CLI and scripts if [ -d /opt/stegasoo/venv/bin ]; then @@ -327,6 +323,15 @@ fi PATHEOF chmod 644 /etc/profile.d/stegasoo-path.sh echo " Installed PATH hook to /etc/profile.d/" +else + echo " PATH hook OK" +fi + +if [ -n "$STEGASOO_DIR" ] && [ -f "$STEGASOO_DIR/rpi/stegasoo-wizard.sh" ]; then + # Install the profile.d hook + cp "$STEGASOO_DIR/rpi/stegasoo-wizard.sh" /etc/profile.d/stegasoo-wizard.sh + chmod 644 /etc/profile.d/stegasoo-wizard.sh + echo " Installed wizard hook to /etc/profile.d/" # Create the first-boot flag touch /etc/stegasoo-first-boot