support de wget
fallback en cas d'absence de curl et wget
This commit is contained in:
parent
9d37d7253a
commit
ca5ac77aec
|
@ -7,10 +7,31 @@ PRIV_REPO=http://vcs.univ.run/anongit/modules/nutools.git
|
||||||
PUB_REPO=http://vcs.univ-reunion.fr/anongit/modules/nutools.git
|
PUB_REPO=http://vcs.univ-reunion.fr/anongit/modules/nutools.git
|
||||||
NAME=nutools
|
NAME=nutools
|
||||||
|
|
||||||
if curl -fs "$PRIV_REPO" >&/dev/null; then
|
################################################################################
|
||||||
REPO="$PRIV_REPO"
|
CURL="$(which curl 2>/dev/null)"
|
||||||
|
WGET="$(which wget 2>/dev/null)"
|
||||||
|
if [ -n "$NUTOOLS_REPO" ]; then
|
||||||
|
REPO="$NUTOOLS_REPO"
|
||||||
|
elif [ -n "$CURL" ]; then
|
||||||
|
if curl -fs "$PRIV_REPO" >&/dev/null; then
|
||||||
|
REPO="$PRIV_REPO"
|
||||||
|
else
|
||||||
|
REPO="$PUB_REPO"
|
||||||
|
fi
|
||||||
|
elif [ -n "$WGET" ]; then
|
||||||
|
if wget -q -O - "$PRIV_REPO" >&/dev/null; then
|
||||||
|
REPO="$PRIV_REPO"
|
||||||
|
else
|
||||||
|
REPO="$PUB_REPO"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
REPO="$PUB_REPO"
|
REPO="$PUB_REPO"
|
||||||
|
echo "\
|
||||||
|
WARN: impossible de déterminer la source pour la mise à jour.
|
||||||
|
sélection de l'adresse publique $PUB_REPO"
|
||||||
|
echo "\
|
||||||
|
NOTE: si une erreur se produit, utiliser l'adresse privée, e.g.
|
||||||
|
NUTOOLS_REPO=$PRIV_REPO $0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $# -ne 1 -o "$1" != --do-update ]; then
|
if [ $# -ne 1 -o "$1" != --do-update ]; then
|
||||||
|
|
Loading…
Reference in New Issue