maj depuis l'adresse publique si l'adresse privée n'est pas accessible

This commit is contained in:
Jephté Clain 2013-12-04 16:31:04 +04:00
parent c84cd3c8ee
commit 9d37d7253a
1 changed files with 9 additions and 2 deletions

View File

@ -3,9 +3,16 @@
SCRIPTNAME=update-nutools
TMPSCRIPT="/tmp/$SCRIPTNAME"
REPO=http://vcs.univ.run/anongit/modules/nutools.git
PRIV_REPO=http://vcs.univ.run/anongit/modules/nutools.git
PUB_REPO=http://vcs.univ-reunion.fr/anongit/modules/nutools.git
NAME=nutools
if curl -fs "$PRIV_REPO" >&/dev/null; then
REPO="$PRIV_REPO"
else
REPO="$PUB_REPO"
fi
if [ $# -ne 1 -o "$1" != --do-update ]; then
cp "$0" "$TMPSCRIPT"
chmod 755 "$TMPSCRIPT"
@ -17,7 +24,7 @@ rm -rf "$NAME"
git clone "$REPO" || exit 1
cd "$NAME"
if ! diff -q "$SCRIPTNAME" "$0"; then
echo "NOTE: Le script $SCRIPTNAME a été mis à jour. Il va va être relancé."
echo "NOTE: Le script $SCRIPTNAME a été mis à jour. Il va être relancé."
exec bash "./$SCRIPTNAME"
fi
bash ./uinst -y || exit 1