32 lines
779 B
Bash
32 lines
779 B
Bash
#!/bin/bash
|
|
# Main GUI service for Rego VPN
|
|
|
|
NOVNC_PORT="${NOVNC_PORT:-8806}"
|
|
DISPLAY_ADDR="${DISPLAY:-:1}"
|
|
|
|
# Start Xvfb
|
|
Xvfb "$DISPLAY_ADDR" -screen 0 ${XVFB_WxHxD:-1280x800x24} +extension RANDR &
|
|
XVFB_PID=$!
|
|
sleep 1
|
|
|
|
export DISPLAY="$DISPLAY_ADDR"
|
|
|
|
# Start window manager
|
|
fluxbox >/tmp/fluxbox.log 2>&1 &
|
|
|
|
# Start VNC server
|
|
x11vnc -display "$DISPLAY_ADDR" -rfbauth /root/.vnc/pass -forever -shared -rfbport 5900 -quiet &
|
|
|
|
# Start websockify for noVNC
|
|
websockify --web=/usr/share/novnc/ 0.0.0.0:"$NOVNC_PORT" localhost:5900 >/tmp/websockify.log 2>&1 &
|
|
|
|
# Start terminal
|
|
sleep 1
|
|
xterm -fa 'Monospace' -fs 11 -bg black -fg white -geometry 120x35+50+50 \
|
|
-T "Rego VPN" -e bash &
|
|
|
|
echo "Rego VPN GUI started on port $NOVNC_PORT"
|
|
|
|
# Wait for Xvfb (main process)
|
|
wait $XVFB_PID
|