nutools/update-nutools

25 lines
599 B
Plaintext
Raw Normal View History

2013-10-24 16:03:50 +04:00
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
TMPSCRIPT=/tmp/update-nutools
REPO=git@vcs.univ.run:modules/nutools.git
NAME=nutools
if [ $# -ne 1 -o "$1" != --do-update ]; then
/bin/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 update-nutools "$0"; then
echo "Le fichier update-nutools a été mis à jour. Ce script va être relancé"
exec bash ./update-nutools
fi
bash ./uinst -y || exit 1
cd ..
rm -rf "$NAME"
rm "$0"; exit 0