A bootstrap script that downloads and installs modules from this repository based on a per-module install.yml manifest. Designed to be invoked directly via curl | bash.
curl -sSL https://raw.githubusercontent.com/descoped/script-utils/master/installer/install.sh | bash -s -- <module_name>
Pipe to
bash, notsh. The script uses Bash 4 features ([[,BASH_REMATCH,local) thatdash/ashsilently miscompile.
The installer downloads <module_name>/install.yml and parses it with a hand-rolled line-based Bash regex. This means the accepted grammar is intentionally small and flat. Do not extend it without switching to a real YAML parser (yq, python -c 'import yaml').
Accepted syntax — each file entry is a - file: line followed by zero or more indented keys:
- file: <path> # required; path relative to the module dir executable: true # optional; chmod +x after download create-symlink: true # optional; create a symlink next to the target, # stripping the extension (.sh, .py, ...) destination: <subdir> # optional; install under $INSTALL_DIR/.<module>/<subdir>/ # instead of at $INSTALL_DIR root
Lines starting with # and blank lines are ignored. Anything else is silently skipped — keep the manifest lean.
Example — see example-install.yml.
Every installable module must ship a checksums.txt alongside install.yml:
<sha256> install.yml
<sha256> <file1>
<sha256> <file2>
Format is standard sha256sum output (hash, two spaces, filename). The installer:
- Downloads
checksums.txtfirst. - Downloads and verifies
install.ymlagainst it (the manifest drives the install, so it must be verified before parsing). - For each listed file, downloads and verifies against the matching entry.
Any missing entry or mismatched hash aborts the install before any chmod +x runs. This closes the supply-chain gap flagged by REQUIREMENTS §3.
To regenerate after editing a module's files:
cd <module>/ shasum -a 256 *.sh *.py README.md install.yml > checksums.txt
| Variable | Purpose |
|---|---|
INSTALL_DIR |
Installation directory. Default $HOME/bin. Skips the interactive prompt when set. |
CONFIRM |
Set to 1 or yes to skip the "Proceed with installation?" prompt. Required when /dev/tty is unavailable. |
SCRIPT_UTILS_REF |
Git ref to fetch from. Default master. Set to a commit SHA (or branch name) for a reproducible install. This repo does not cut tagged releases — master is the normal case. |
SCRIPT_UTILS_OWNER |
GitHub owner. Default descoped. Override for forks. |
SCRIPT_UTILS_REPO |
GitHub repo. Default script-utils. Override for forks. |
ALLOW_UNVERIFIED |
Set to 1 to proceed when checksums.txt is missing. Insecure — use only as a short-term escape hatch. The installer prints a loud warning and emits an "UNVERIFIED" completion message. |
Install to a custom directory:
curl -sSL https://raw.githubusercontent.com/descoped/script-utils/master/installer/install.sh \
| INSTALL_DIR=/opt/script-utils bash -s -- append-filesPin to a specific commit (e.g. for an airgapped rebuild or a known-good state):
SHA=<40-char-sha> curl -sSL "https://raw.githubusercontent.com/descoped/script-utils/$SHA/installer/install.sh" \ | SCRIPT_UTILS_REF="$SHA" bash -s -- append-files
Non-interactive install (CI):
curl -sSL https://raw.githubusercontent.com/descoped/script-utils/master/installer/install.sh \ | INSTALL_DIR=$HOME/bin CONFIRM=1 bash -s -- append-files
- INFO (green) — normal progress
- WARN (yellow) — non-fatal issues, including the
ALLOW_UNVERIFIED=1bypass - ERROR (red, stderr) — fatal
- DEBUG (blue) — currently unused
0— success, or user-declined install1— download, verification, or parse failure