Capture the current CyberLux UI, commerce, messaging, and Tor ops updates so local main can be pushed to the remote. Made-with: Cursor
20 lines
558 B
Bash
Executable File
20 lines
558 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Start CyberLux onion backend if 127.0.0.1:3000 is not already occupied.
|
|
# Used by the user systemd unit and @reboot cron fallback.
|
|
|
|
set -euo pipefail
|
|
|
|
REPO="/home/drjones/cyberlux"
|
|
LOG="${REPO}/logs/onion-runtime.log"
|
|
|
|
mkdir -p "${REPO}/logs"
|
|
|
|
if command -v ss >/dev/null 2>&1 && ss -ltn 'sport = :3000' | grep -q '127.0.0.1:3000'; then
|
|
echo "$(date -Is) cyberlux already listening on 127.0.0.1:3000" >>"${LOG}"
|
|
exit 0
|
|
fi
|
|
|
|
cd "${REPO}"
|
|
node scripts/generate-onion-config.cjs >>"${LOG}" 2>&1
|
|
exec npm run start:onion >>"${LOG}" 2>&1
|