diff --git a/README.md b/README.md index cd7d3e6..3a2b44d 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,9 @@ HOSTNAME=tunbox MEMORY=512 STORAGE=fast-nvme \ bash -c "$(curl -fsSL https://git.d4nn13.de/d4nn13/wirecon/raw/branch/main/proxmox/create-lxc.sh)" ``` -Available overrides: `HOSTNAME`, `CORES`, `MEMORY`, `DISK`, `BRIDGE`, `STORAGE`, `TEMPLATE_STORAGE`, `WIRECON_REPO`, `WIRECON_REF`, `ROOT_PASSWORD`. +Available overrides: `HOSTNAME`, `CORES`, `MEMORY`, `DISK`, `BRIDGE`, `STORAGE`, `TEMPLATE_STORAGE`, `WIRECON_REPO`, `WIRECON_REF`, `ROOT_PASSWORD`, `WIRECON_WEB_AUTOSTART` (yes/no). + +The script also asks (interactively, default **yes**) whether to enable the web UI on boot. Edit configs in-browser right after provisioning instead of `vi`'ing over `pct enter`. ### Root login diff --git a/proxmox/create-lxc.sh b/proxmox/create-lxc.sh index 5e41dad..01098c3 100755 --- a/proxmox/create-lxc.sh +++ b/proxmox/create-lxc.sh @@ -66,6 +66,22 @@ if [[ -z "${ROOT_PASSWORD:-}" ]]; then fi fi +# --- web UI autostart ------------------------------------------------------- +# WIRECON_WEB_AUTOSTART=yes|no overrides the prompt. Default: yes (the UI is +# how you'll edit wg0.conf / wirecon.conf without drop-to-shell). +if [[ -z "${WIRECON_WEB_AUTOSTART:-}" ]]; then + if [[ -r /dev/tty && -w /dev/tty ]]; then + printf 'start web UI automatically on boot? [Y/n] ' >/dev/tty + IFS= read -r _ans