From b46fb1af7a9347db50330bf94ff0f60779916d49 Mon Sep 17 00:00:00 2001 From: Michel Le Cocq Date: Mon, 10 Mar 2025 06:39:23 +0100 Subject: [PATCH] commentaires --- upsnapz.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/upsnapz.sh b/upsnapz.sh index ae7f636..7a0165f 100755 --- a/upsnapz.sh +++ b/upsnapz.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Time-stamp: <2025-03-09 16:10:47 nomad> +# Time-stamp: <2025-03-10 06:39:12 nomad> # Michel Le Cocq # @@ -21,7 +21,8 @@ # tunable variable -LOG_FILE=~/upsnapz.log +# /!\ il faut ecrire ce fichier dans le vol bootfs sinon ca a peu d'interet +LOG_FILE=/root/upsnapz.log # Dependencies : # - gh @@ -30,7 +31,9 @@ LOG_FILE=~/upsnapz.log # +------------------------------------------------------------------------------------------------+ # To do or not : # +# - il n'y a plus la sortie couleur sur stdout # - regarder si un nouveau kernel existe et si oui faire ce qu'il y a a faire +# uname -r # - verifier que les noms des zroot/ROOT/vol sont conformes au format attendu # - verfier que 'gh auth status' fonctionne avant de l'utiliser (auth) # - ameliorer l'integration de : apt full-upgrade @@ -321,7 +324,7 @@ function askupgrade() printf '%s\n' 'apt -y upgrade' sudo apt -y upgrade | tee -a /tmp/upsnapz-upgradable fi - cat /tmp/upsnapz-upgradable >> $LOG_FILE + sudo cat /tmp/upsnapz-upgradable >> $LOG_FILE else echo no fi @@ -349,26 +352,32 @@ function checkupgrade() function usage() { echo "Usage: $(basename $0) [-h]" - echo "-b : only check zfs boot menu" - echo "-s : only show zfs snap" + echo "-b : run only check zfs boot menu" + echo "-s : run only show zfs snap" + echo "-S : ron only snanpshot bootfs" } -while getopts 'hbs' OPTION; do +while getopts 'hbsS' OPTION; do case "$OPTION" in h) usage - exit 1 + exit 0 ;; b) check_ZFS_BOOT_MENU echo - exit 1 + exit 0 ;; s) showsnap echo - exit 1 - ;; + exit 0 + ;; + S) + asksnap + echo + exit 0 + ;; ?) usage exit 1