Skip required-packages step on re-run
On second run, is_installed base (command -v ncdu) detects that base packages are already present and jumps straight to the service menu, skipping the required-setup banner, confirm prompt, and apt-get install. The first-run path is unchanged; `sudo ./setup.sh base` forces reinstall. https://claude.ai/code/session_01Y4dMKtkqkpvmgDKoRdzhTG
This commit is contained in:
@@ -152,31 +152,44 @@ fi
|
|||||||
# ── Guided interactive flow ──────────────────────────────────────────────────
|
# ── Guided interactive flow ──────────────────────────────────────────────────
|
||||||
require_root
|
require_root
|
||||||
|
|
||||||
# 1) Show the REQUIRED set and let the user cancel before anything happens.
|
_VER="$(cat "$HERE/VERSION" 2>/dev/null || echo '?')"
|
||||||
echo ""
|
|
||||||
echo "╔══════════════════════════════════════════════════════════════╗"
|
if is_installed base; then
|
||||||
echo "║ Ubuntu Post-Install · v$(cat "$HERE/VERSION" 2>/dev/null || echo '?')"
|
# ── Re-run: base already present — skip required step ────────────────────
|
||||||
echo "╚══════════════════════════════════════════════════════════════╝"
|
echo ""
|
||||||
echo ""
|
echo "╔══════════════════════════════════════════════════════════════╗"
|
||||||
echo "REQUIRED (installed/verified first):"
|
echo "║ Ubuntu Post-Install · v${_VER}"
|
||||||
echo " • Essential CLI packages: net-tools, git, curl, wget, htop, tree,"
|
echo "╚══════════════════════════════════════════════════════════════╝"
|
||||||
echo " ncdu, zip/unzip, jq, rsync, and glow (markdown reader)"
|
echo ""
|
||||||
echo " • Docker presence check (needed by all containerized services)"
|
echo " Base packages already installed — skipping required setup."
|
||||||
echo ""
|
echo " Use 'sudo ./setup.sh base' to force a reinstall."
|
||||||
echo "Then you'll get a category menu to pick optional services."
|
echo ""
|
||||||
echo ""
|
else
|
||||||
PROCEED=""
|
# ── First run: show required banner, confirm, install ────────────────────
|
||||||
prompt_yn "Proceed with the required setup? (y/n):" "y" PROCEED
|
echo ""
|
||||||
if [ "$PROCEED" != "y" ] && [ "$PROCEED" != "Y" ]; then
|
echo "╔══════════════════════════════════════════════════════════════╗"
|
||||||
|
echo "║ Ubuntu Post-Install · v${_VER}"
|
||||||
|
echo "╚══════════════════════════════════════════════════════════════╝"
|
||||||
|
echo ""
|
||||||
|
echo "REQUIRED (installed/verified first):"
|
||||||
|
echo " • Essential CLI packages: net-tools, git, curl, wget, htop, tree,"
|
||||||
|
echo " ncdu, zip/unzip, jq, rsync, and glow (markdown reader)"
|
||||||
|
echo " • Docker presence check (needed by all containerized services)"
|
||||||
|
echo ""
|
||||||
|
echo "Then you'll get a category menu to pick optional services."
|
||||||
|
echo ""
|
||||||
|
PROCEED=""
|
||||||
|
prompt_yn "Proceed with the required setup? (y/n):" "y" PROCEED
|
||||||
|
if [ "$PROCEED" != "y" ] && [ "$PROCEED" != "Y" ]; then
|
||||||
echo "Cancelled. Nothing was changed."
|
echo "Cancelled. Nothing was changed."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 2) Run required.
|
run_service base
|
||||||
run_service base
|
if ! command -v docker >/dev/null 2>&1; then
|
||||||
if ! command -v docker >/dev/null 2>&1; then
|
|
||||||
log_warning "Docker is not installed. Containerized services need it."
|
log_warning "Docker is not installed. Containerized services need it."
|
||||||
echo " Install with: curl -fsSL https://get.docker.com | sh"
|
echo " Install with: curl -fsSL https://get.docker.com | sh"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 3) Offer site defaults wizard if .config has no SITE_TZ yet (first run).
|
# 3) Offer site defaults wizard if .config has no SITE_TZ yet (first run).
|
||||||
|
|||||||
Reference in New Issue
Block a user