15 lines
706 B
Bash
15 lines
706 B
Bash
#!/usr/bin/env bash
|
|
# Tiny shared helpers. Source this; don't execute.
|
|
|
|
info() { echo ">> $*"; }
|
|
die() { echo "ERROR: $*" >&2; exit 1; }
|
|
|
|
# deploy <path-under-root> [mode] : copy 02-system/files/<path> to /<path>
|
|
# e.g. deploy etc/logid.cfg | deploy usr/local/bin/gpuprofile.sh 755
|
|
deploy() { install -Dm"${2:-644}" "files/$1" "/$1" && info "deployed /$1"; }
|
|
|
|
# enable a systemd unit only if it exists (some come from AUR, installed later)
|
|
enable_unit() { systemctl enable "$@" 2>/dev/null && info "enabled $*" || echo " skip (no unit): $*"; }
|
|
|
|
# install every package named in a file (ignores # comments and blank lines)
|
|
pac_file() { pacman -S --needed --noconfirm $(grep -vE '^\s*#|^\s*$' "$1"); } |