add pdf rotate tools; fix lpstat datetime format pattern
[hband-tools.git] / git-server / git-repo-mgmt
blob61e2da88f0824a0e82b127968d922adc860ea627
1 #!/bin/bash
3 set -u
5 directory=$1
7 echo "----" >&2
8 echo "Performing repo management commands..." >&2
11 set -e
12 set -o pipefail
14 GIT_DIR="$directory" git show repo-mgmt:access |\
15 while read -r line
17 case "$line" in
18 public)
19 echo "Making '$directory' public..." >&2
20 chmod o+rx "$directory"
22 private)
23 echo "Making '$directory' private..." >&2
24 setfacl -b "$directory"
25 chmod g-rwx,o-rwx "$directory"
27 default)
28 # leave permissions as they are set at the beginning
29 true
31 delete)
32 echo "Deleting '$directory'..." >&2
33 rm -rf --one-file-system "$directory"
36 echo "Unknown directive: '$line'" >&2
38 esac
39 done
42 errstatus=$?
43 echo "Repo management commands are over." >&2
44 echo "----" >&2
45 exit $errstatus