- ajout d'une mise à jour du script au démarage

This commit is contained in:
Frogg 2026-05-11 20:16:21 +02:00
parent 7ad617381b
commit b9b76c7f69
1 changed files with 5 additions and 5 deletions

View File

@ -63,12 +63,12 @@ gitssl() {
script_update() {
local BRANCH LOCAL REMOTE
cd "$WELCOME_SCRIPT_PATH" || exit 2
cd "$WELCOME_SCRIPT_PATH" || return 2
git fetch origin
if [ $? -ne 0 ]; then
msg_error "Erreur lors du Fetch"
exit 3
return 3
fi
BRANCH=$(git rev-parse --abbrev-ref HEAD)
@ -76,16 +76,16 @@ LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse origin/"$BRANCH")
if [ "$LOCAL" = "$REMOTE" ]; then
exit 0
return 0
fi
# update
git reset --hard origin/"$BRANCH"
if [ $? -eq 0 ]; then
msg_success "Les script de welcome a été mis à jour"
exit 1
return 1
else
msg_error "Erreur lors de la mise à jour du script"
exit 4
return 4
fi
}