26 lines
616 B
Bash
Executable File
26 lines
616 B
Bash
Executable File
#!/bin/bash
|
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
|
|
|
SCRIPTNAME=update-nutools
|
|
TMPSCRIPT="/tmp/$SCRIPTNAME"
|
|
REPO=git@vcs.univ.run:modules/nutools.git
|
|
NAME=nutools
|
|
|
|
if [ $# -ne 1 -o "$1" != --do-update ]; then
|
|
cp "$0" "$TMPSCRIPT"
|
|
chmod 755 "$TMPSCRIPT"
|
|
exec bash "$TMPSCRIPT" --do-update
|
|
fi
|
|
|
|
cd /tmp
|
|
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é."
|
|
exec bash "./$SCRIPTNAME"
|
|
fi
|
|
bash ./uinst -y || exit 1
|
|
cd ..
|
|
rm -rf "$NAME"
|
|
rm "$0"; exit 0 |