2011-02-04 16:58:23 +01:00
|
|
|
#!/bin/sh
|
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"
|
|
|
|
;;
|
|
|
|
* )
|
2010-11-16 15:39:45 +01:00
|
|
|
loc="$GL_REPO_BASE_ABS/$1.git"
|
2010-05-31 17:09:45 +02:00
|
|
|
[ -d $loc ] && locs="$locs $GL_REPO_BASE_ABS/$1.git"
|
|
|
|
[ -d $loc ] || echo "ignoring $1..."
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2011-02-04 16:58:23 +01:00
|
|
|
[ -z "$locs" ] && die "give me '@all' or some reponame"
|
2010-11-16 15:39:45 +01:00
|
|
|
|
2010-05-31 17:09:45 +02:00
|
|
|
case $op in
|
|
|
|
en|enable )
|
|
|
|
for l in $locs
|
|
|
|
do
|
|
|
|
rm -fv $l/.gitolite.down
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
dis|disable )
|
2011-02-04 16:58:23 +01:00
|
|
|
|
|
|
|
TEMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX)
|
|
|
|
export TEMPDIR
|
|
|
|
trap "/bin/rm -rf $TEMPDIR" 0
|
|
|
|
|
|
|
|
echo 'type the message to be shown to users when they try to push; end with Ctrl-D:'
|
|
|
|
echo > $TEMPDIR/msg
|
|
|
|
cat >> $TEMPDIR/msg
|
2010-11-16 15:39:45 +01:00
|
|
|
echo disabling following locations with message:
|
2011-02-04 16:58:23 +01:00
|
|
|
cat $TEMPDIR/msg
|
2010-11-16 15:39:45 +01:00
|
|
|
echo
|
2010-05-31 17:09:45 +02:00
|
|
|
for l in $locs
|
|
|
|
do
|
2011-02-04 16:58:23 +01:00
|
|
|
cat $TEMPDIR/msg > $l/.gitolite.down
|
2010-11-16 15:39:45 +01:00
|
|
|
echo $l
|
2010-05-31 17:09:45 +02:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
die "argument 1 must be 'en' or 'dis'"
|
|
|
|
;;
|
|
|
|
esac
|