commentaires

This commit is contained in:
Michel Le Cocq 2025-03-10 06:39:23 +01:00
parent 6f2fa5ab86
commit b46fb1af7a

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Time-stamp: <2025-03-09 16:10:47 nomad> # Time-stamp: <2025-03-10 06:39:12 nomad>
# Michel Le Cocq <lecocq@ipgp.fr> # Michel Le Cocq <lecocq@ipgp.fr>
# <nomad@neuronfarm.net> # <nomad@neuronfarm.net>
@ -21,7 +21,8 @@
# tunable variable # 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 : # Dependencies :
# - gh # - gh
@ -30,7 +31,9 @@ LOG_FILE=~/upsnapz.log
# +------------------------------------------------------------------------------------------------+ # +------------------------------------------------------------------------------------------------+
# To do or not : # 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 # - 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 # - verifier que les noms des zroot/ROOT/vol sont conformes au format attendu
# - verfier que 'gh auth status' fonctionne avant de l'utiliser (auth) # - verfier que 'gh auth status' fonctionne avant de l'utiliser (auth)
# - ameliorer l'integration de : apt full-upgrade # - ameliorer l'integration de : apt full-upgrade
@ -321,7 +324,7 @@ function askupgrade()
printf '%s\n' 'apt -y upgrade' printf '%s\n' 'apt -y upgrade'
sudo apt -y upgrade | tee -a /tmp/upsnapz-upgradable sudo apt -y upgrade | tee -a /tmp/upsnapz-upgradable
fi fi
cat /tmp/upsnapz-upgradable >> $LOG_FILE sudo cat /tmp/upsnapz-upgradable >> $LOG_FILE
else else
echo no echo no
fi fi
@ -349,25 +352,31 @@ function checkupgrade()
function usage() function usage()
{ {
echo "Usage: $(basename $0) [-h]" echo "Usage: $(basename $0) [-h]"
echo "-b : only check zfs boot menu" echo "-b : run only check zfs boot menu"
echo "-s : only show zfs snap" 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 case "$OPTION" in
h) h)
usage usage
exit 1 exit 0
;; ;;
b) b)
check_ZFS_BOOT_MENU check_ZFS_BOOT_MENU
echo echo
exit 1 exit 0
;; ;;
s) s)
showsnap showsnap
echo echo
exit 1 exit 0
;;
S)
asksnap
echo
exit 0
;; ;;
?) ?)
usage usage