aboutsummaryrefslogtreecommitdiffstats
path: root/skein-infra
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xskein-infra (renamed from cgit-chroot)26
1 files changed, 13 insertions, 13 deletions
diff --git a/cgit-chroot b/skein-infra
index 5d229db..44f55a5 100755
--- a/cgit-chroot
+++ b/skein-infra
@@ -2,11 +2,11 @@
set -e
-CGIT_CHROOT=${CGIT_CHROOT:-/srv/cgit}
-CGIT_GIT_ROOT=${CGIT_GIT_ROOT:-/srv/git}
+SKEIN_CGIT_ROOT=${SKEIN_CGIT_ROOT:-/srv/cgit}
+SKEIN_GIT_ROOT=${SKEIN_GIT_ROOT:-/srv/git}
usage() {
- printf 'usage: cgit-chroot setup|teardown\n' >&2
+ printf 'usage: skein-infra setup|teardown\n' >&2
exit 1
}
@@ -23,7 +23,7 @@ ldel() {
}
remove_prefix() {
- printf "%s" "${1#$CGIT_CHROOT/*}"
+ printf "%s" "${1#$SKEIN_CGIT_ROOT/*}"
}
bind_mount() {
@@ -40,19 +40,19 @@ bind_umount() {
}
setup() {
- mkdir "$CGIT_CHROOT"/dev
- mknod "$CGIT_CHROOT"/dev/null c 1 3
- chmod 666 "$CGIT_CHROOT"/dev/null
+ mkdir "$SKEIN_CGIT_ROOT"/dev
+ mknod "$SKEIN_CGIT_ROOT"/dev/null c 1 3
+ chmod 666 "$SKEIN_CGIT_ROOT"/dev/null
- for i in "$CGIT_CHROOT"/instances/*; do
+ for i in "$SKEIN_CGIT_ROOT"/instances/*; do
test -d "$i" || continue
user=$(basename "$i")
id -ru "$user" >/dev/null || continue
- git_repo_dir="${CGIT_GIT_ROOT}/$user"
+ git_repo_dir="${SKEIN_GIT_ROOT}/$user"
test -d "$git_repo_dir" || continue
- instance_repo_dir="$CGIT_CHROOT"/instances/$user/repos
+ instance_repo_dir="$SKEIN_CGIT_ROOT"/instances/$user/repos
bind_mount "$git_repo_dir" "$instance_repo_dir"
chmod 0701 "$instance_repo_dir"
@@ -60,10 +60,10 @@ setup() {
}
teardown() {
- rm "$CGIT_CHROOT"/dev/null
- rmdir "$CGIT_CHROOT"/dev
+ rm "$SKEIN_CGIT_ROOT"/dev/null
+ rmdir "$SKEIN_CGIT_ROOT"/dev
- for i in "$CGIT_CHROOT"/instances/*/repos; do
+ for i in "$SKEIN_CGIT_ROOT"/instances/*/repos; do
bind_umount "$i"
done
}