# Adding a new script Two files per app, both sourcing the shared libs at runtime. ## 1. `install/-install.sh` — runs inside the LXC ```bash #!/usr/bin/env bash set -euo pipefail APP="myapp" LIB_URL="${LIB_URL:-https://gitea.luki-net.org/luki-net/proxmox-scripts/raw/branch/main/lib}" source <(curl -fsSL "$LIB_URL/install.func") [[ "$EUID" -eq 0 ]] || { msg_err "Must run as root"; exit 1; } setup_base_apt git some-package # base packages + extras create_system_user myapp /opt/myapp # ... app-specific install ... write_systemd_unit myapp "$(cat <.sh` — runs on the Proxmox host ```bash #!/usr/bin/env bash set -euo pipefail APP="myapp" APP_DESCRIPTION="short tagline" APP_PORT="8080" LIB_URL="${LIB_URL:-https://gitea.luki-net.org/luki-net/proxmox-scripts/raw/branch/main/lib}" INSTALL_SCRIPT_URL="${INSTALL_SCRIPT_URL:-https://gitea.luki-net.org/luki-net/proxmox-scripts/raw/branch/main/install/myapp-install.sh}" # App-specific defaults DEFAULT_HOSTNAME="myapp" DEFAULT_DISK="10" DEFAULT_CORES="2" DEFAULT_RAM="1024" source <(curl -fsSL "$LIB_URL/build.func") # Override the default summary printer with whatever the app needs. print_app_summary() { cat <.credentials` (chmod 600). The host-side `print_app_summary` can `pct exec` to read them back. - **Env-driven non-interactive use**: ```bash CTID=200 HOSTNAME=myapp DISK_SIZE=30 RAM=4096 IPCFG=dhcp \ bash -c "$(curl -fsSL .../ct/myapp.sh)" ``` - **Local testing**: set `LIB_URL` to your fork's URL or a feature branch to test lib changes without touching `main`.