42 lines
696 B
Bash
Executable file
42 lines
696 B
Bash
Executable file
#!/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() {
|
|
prefix="$1"
|
|
owner="$2"
|
|
group="$3"
|
|
mode="$4"
|
|
path="$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"
|