2010-05-31 17:09:45 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2010-06-01 12:57:33 +02:00
|
|
|
# WARNING: USES BASH FEATURES TO AVOID A TEMP FILE; CAN BE FIXED IF NEEDED
|
2010-05-31 17:09:45 +02:00
|
|
|
|
|
|
|
. $(dirname $0)/adc.common-functions
|
|
|
|
|
|
|
|
get_rights_and_owner gitolite-admin
|
2010-06-01 12:57:33 +02:00
|
|
|
[ -z "$perm_write" ] && die "just *what* are you trying to pull, young man?"
|
2010-05-31 17:09:45 +02:00
|
|
|
|
|
|
|
op=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
locs=
|
2010-06-01 12:57:33 +02:00
|
|
|
while [ -n "$1" ]
|
2010-05-31 17:09:45 +02:00
|
|
|
do
|
|
|
|
case $1 in
|
|
|
|
'@all' )
|
|
|
|
locs="$locs $HOME"
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
[ -d $loc ] && locs="$locs $GL_REPO_BASE_ABS/$1.git"
|
|
|
|
[ -d $loc ] || echo "ignoring $1..."
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
case $op in
|
|
|
|
en|enable )
|
|
|
|
for l in $locs
|
|
|
|
do
|
|
|
|
rm -fv $l/.gitolite.down
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
dis|disable )
|
2010-06-01 12:57:33 +02:00
|
|
|
# bashism
|
2010-05-31 17:09:45 +02:00
|
|
|
read msg <<<$(cat)
|
|
|
|
for l in $locs
|
|
|
|
do
|
|
|
|
echo $msg > $l/.gitolite.down
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
die "argument 1 must be 'en' or 'dis'"
|
|
|
|
;;
|
|
|
|
esac
|