-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.sh
More file actions
59 lines (46 loc) · 2.18 KB
/
bootstrap.sh
File metadata and controls
59 lines (46 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
# HyprArch - bootstrap
# One-liner entry point for archiso:
# curl -sL https://install.jallits.com/hyprarch | bash
#
# Clones the full repository and hands off to install.sh.
set -euo pipefail
REPO_URL="https://github.com/djallits/hyprarch.git"
INSTALL_DIR="/root/hyprarch"
BRANCH="${HYPRARCH_BRANCH:-master}"
# ── Preflight checks ──────────────────────────────────────────────────
if [[ ! -d /run/archiso ]]; then
printf 'ERROR: This script must be run from the Arch Linux ISO environment.\n' >&2
exit 1
fi
if (( EUID != 0 )); then
printf 'ERROR: This script must be run as root.\n' >&2
exit 1
fi
if [[ ! -d /sys/firmware/efi ]]; then
printf 'ERROR: UEFI boot mode is required.\n' >&2
exit 1
fi
if ! curl -sf --max-time 10 https://archlinux.org > /dev/null 2>&1; then
printf 'ERROR: No network connectivity. Connect to the internet first.\n' >&2
printf 'Hint: iwctl station wlan0 connect <SSID>\n' >&2
exit 1
fi
# ── Dependencies ───────────────────────────────────────────────────────
if ! command -v git &> /dev/null; then
printf 'Installing git...\n'
pacman -Sy --noconfirm git
fi
# ── Clone or update ───────────────────────────────────────────────────
if [[ -d "${INSTALL_DIR}/.git" ]]; then
printf 'Updating existing hyprarch checkout...\n'
git -C "${INSTALL_DIR}" fetch origin
git -C "${INSTALL_DIR}" reset --hard "origin/${BRANCH}"
else
printf 'Cloning hyprarch (%s)...\n' "${BRANCH}"
git clone --branch "${BRANCH}" --depth 1 "${REPO_URL}" "${INSTALL_DIR}"
fi
# ── Hand off to the real installer ────────────────────────────────────
# Redirect stdin from /dev/tty so the TUI can read interactive input
# even when bootstrap.sh was invoked via curl | bash (piped stdin)
exec bash "${INSTALL_DIR}/install.sh" "$@" < /dev/tty