diff --git a/README.md b/README.md index 4c1ca6e..6574263 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,16 @@ Prepare the USB once on any machine (no git required): 2. Unzip it — you'll get a folder called `ubuntu-post-install-main` 3. Copy that folder to your USB drive -On every new box — plug in USB, open a terminal, run: -```bash -sudo bash /media/$(whoami)/DRIVENAME/ubuntu-post-install-main/bootstrap.sh -``` -`bootstrap.sh` detects it is running from inside the repo, copies everything -to `~/ubuntu-post-install`, then launches the wizard — so the USB can be -unplugged once setup starts. No auth, no internet needed for the scripts -themselves (services still pull packages and Docker images over the network). +On every new box: +1. Plug in the USB — it opens in the file manager +2. Navigate into the `ubuntu-post-install-main` folder +3. **Either:** + - Right-click inside the folder → **Open in Terminal** → type `bash bootstrap.sh` + - **Or** double-click `bootstrap.sh` → if prompted, choose **Run in Terminal** -> **Finding your drive name:** Ubuntu mounts USB drives at `/media/USERNAME/DRIVENAME`. -> Run `ls /media/$(whoami)/` right after plugging in to see it. +The script asks for your password if needed. It detects it is running from +inside the repo, copies everything to `~/ubuntu-post-install`, then launches +the wizard — the USB can be unplugged once setup starts. **Private repo — PAT (alternative):** ```bash diff --git a/bootstrap.sh b/bootstrap.sh index a053159..af9e050 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -17,6 +17,11 @@ # connected machine, put the directory on a USB drive, done. set -euo pipefail +# Self-elevate: if double-clicked or run without sudo, ask for password. +if [ "$(id -u)" -ne 0 ]; then + exec sudo bash "$0" "$@" +fi + REPO_URL="https://github.com/outis1one/ubuntu-post-install.git" # Resolve actual user home when running under sudo