19 lines
1.0 KiB
Bash
19 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
# Chrome listens on 127.0.0.1:9223; proxy on 9222 rewrites Host so CDP accepts external connections
|
|
export APP_ARGS="${APP_ARGS//9222/9223}"
|
|
# Persist APP_ARGS so desktop shortcut (launched without this env) can launch Chrome with same profile/CDP
|
|
printf '%s' "$APP_ARGS" > /tmp/chrome_app_args
|
|
# Ensure Chrome shortcut and floating launcher autostart exist
|
|
mkdir -p "$HOME/Desktop" "$HOME/.config/autostart"
|
|
cp -f /dockerstartup/google-chrome.desktop "$HOME/Desktop/" && chmod +x "$HOME/Desktop/google-chrome.desktop"
|
|
cp -f /dockerstartup/open-chrome-launcher.desktop "$HOME/.config/autostart/"
|
|
# Watchdog: restart Chrome when it's closed so user can always get a window back
|
|
chrome_restart() {
|
|
/usr/bin/desktop_ready 2>/dev/null || true
|
|
/dockerstartup/launch_chrome.sh &
|
|
}
|
|
( sleep 15; while true; do sleep 2; pgrep -x chrome >/dev/null || chrome_restart; done ) &
|
|
python3 /dockerstartup/cdp_proxy.py &
|
|
exec /dockerstartup/kasm_default_profile.sh /dockerstartup/vnc_startup.sh /dockerstartup/kasm_startup.sh "$@"
|