Make PATH hook a check/fix step in sanitize
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 <noreply@anthropic.com>
This commit is contained in:
@@ -309,13 +309,9 @@ if [ -n "$STEGASOO_DIR" ] && [ -d "$STEGASOO_DIR/venv" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$STEGASOO_DIR" ] && [ -f "$STEGASOO_DIR/rpi/stegasoo-wizard.sh" ]; then
|
# Ensure PATH hook exists for stegasoo CLI and scripts
|
||||||
# Install the profile.d hook
|
if [ ! -f /etc/profile.d/stegasoo-path.sh ]; then
|
||||||
cp "$STEGASOO_DIR/rpi/stegasoo-wizard.sh" /etc/profile.d/stegasoo-wizard.sh
|
echo " Creating PATH hook..."
|
||||||
chmod 644 /etc/profile.d/stegasoo-wizard.sh
|
|
||||||
echo " Installed wizard hook to /etc/profile.d/"
|
|
||||||
|
|
||||||
# Add stegasoo to PATH for all users
|
|
||||||
cat > /etc/profile.d/stegasoo-path.sh <<'PATHEOF'
|
cat > /etc/profile.d/stegasoo-path.sh <<'PATHEOF'
|
||||||
# Stegasoo CLI and scripts
|
# Stegasoo CLI and scripts
|
||||||
if [ -d /opt/stegasoo/venv/bin ]; then
|
if [ -d /opt/stegasoo/venv/bin ]; then
|
||||||
@@ -327,6 +323,15 @@ fi
|
|||||||
PATHEOF
|
PATHEOF
|
||||||
chmod 644 /etc/profile.d/stegasoo-path.sh
|
chmod 644 /etc/profile.d/stegasoo-path.sh
|
||||||
echo " Installed PATH hook to /etc/profile.d/"
|
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
|
# Create the first-boot flag
|
||||||
touch /etc/stegasoo-first-boot
|
touch /etc/stegasoo-first-boot
|
||||||
|
|||||||
Reference in New Issue
Block a user