#!/bin/bash
# RTExit Kali — Entrypoint Script

# Source aliases
source /etc/profile.d/rtexit-aliases.sh 2>/dev/null

# Create workspace if mounted
mkdir -p /workspace/engagement
cd /workspace

# Start services if needed
if [ "$START_SERVICES" = "true" ]; then
    service postgresql start 2>/dev/null
    msfdb init 2>/dev/null &
fi

# Execute command or drop to shell
if [ "$#" -gt 0 ]; then
    exec "$@"
else
    exec /bin/bash
fi
