#!/bin/sh # usage: # # sudo ./install # sudo ./install gentoo # # env vars: # # VERSION_CONTROL # SIMPLE_BACKUP_SUFFIX # # see man install(1) set -eu REPO="$(dirname "$(realpath "$0")")" PREFIX="${1:-''}" install_file() { owner="$1" group="$2" mode="$3" path="$4" prefix="$5" echo install -b -o "$owner" -g "$group" -m "$mode" "$REPO/$prefix$path" "$path" install -b -o "$owner" -g "$group" -m "$mode" "$REPO/$prefix$path" "$path" } install_dir() { owner="$1" group="$2" mode="$3" path="$4" echo install -o "$owner" -g "$group" -m "$mode" -d "$path" install -o "$owner" -g "$group" -m "$mode" -d "$path" } . "$REPO/files.sh"