Files
ubuntu-post-install/bootstrap.sh
T
Claude 33f052ea0b Add bootstrap.sh and rewrite README for modular system
bootstrap.sh: one curl | sudo bash to get and run on a fresh box —
installs git if missing, clones/updates the repo, execs setup.sh.

README.md: complete rewrite. The old README described the monolithic
script (--restore, --migrate flags, Samba, NetBird, etc.) which no
longer exists. New README covers quick start, usage modes, service
table, layout, and managing installed services.

https://claude.ai/code/session_01Y4dMKtkqkpvmgDKoRdzhTG
2026-06-04 00:26:09 +00:00

48 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# bootstrap.sh — get and run ubuntu-post-install on a fresh system.
#
# One command to paste into a new Ubuntu box:
# curl -fsSL https://raw.githubusercontent.com/outis1one/ubuntu-post-install/main/bootstrap.sh | sudo bash
#
# What it does:
# 1. Installs git if missing (the only hard dependency)
# 2. Clones (or updates) the repo to ~/ubuntu-post-install
# 3. Launches the interactive setup wizard
set -euo pipefail
REPO_URL="https://github.com/outis1one/ubuntu-post-install.git"
DEST="${HOME:-/root}/ubuntu-post-install"
# Resolve actual user home when running under sudo
if [ -n "${SUDO_USER:-}" ]; then
ACTUAL_HOME="$(getent passwd "$SUDO_USER" | cut -d: -f6)"
DEST="$ACTUAL_HOME/ubuntu-post-install"
fi
echo ""
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ ubuntu-post-install · bootstrap ║"
echo "╚══════════════════════════════════════════════════════════════╝"
echo ""
# 1) Ensure git is available
if ! command -v git >/dev/null 2>&1; then
echo "Installing git..."
apt-get update -qq && apt-get install -y git
fi
# 2) Clone or update
if [ -d "$DEST/.git" ]; then
echo "Repo already exists at $DEST — pulling latest..."
git -C "$DEST" pull --ff-only || echo " (pull failed — continuing with existing version)"
else
echo "Cloning to $DEST ..."
git clone "$REPO_URL" "$DEST"
fi
echo ""
echo "Launching setup..."
echo ""
exec bash "$DEST/setup.sh"