38 lines
692 B
Bash
38 lines
692 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# 🧹 Nettoyage écran
|
|
clear
|
|
|
|
LOG_DIR="/var/log/lxc-updater-TM"
|
|
LOG_FILE="${LOG_DIR}/lxc-updater-run.log"
|
|
|
|
mkdir -p "$LOG_DIR"
|
|
: > "$LOG_FILE"
|
|
|
|
log() {
|
|
echo "$1"
|
|
echo "$1" >> "$LOG_FILE"
|
|
}
|
|
|
|
BASE="https://git.thomasmlg.fr/thomas/Docker/raw/branch/release"
|
|
DIR="/opt/lxc-updater"
|
|
|
|
mkdir -p "$DIR"
|
|
cd "$DIR"
|
|
|
|
log "🧰 Téléchargement des scripts"
|
|
|
|
curl -fsSL "$BASE/detect.sh" -o detect.sh >>"$LOG_FILE" 2>&1
|
|
curl -fsSL "$BASE/update.sh" -o update.sh >>"$LOG_FILE" 2>&1
|
|
|
|
chmod +x detect.sh update.sh
|
|
|
|
METHOD="$(./detect.sh)"
|
|
|
|
log "🧭 Mode de mise à jour : $METHOD"
|
|
|
|
./update.sh "$METHOD"
|
|
|
|
log "🧾 Log run : $LOG_FILE"
|
|
log "🎉 Script terminé" |