diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 539416d485..0461efff74 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ New images: New software: Enhancements: +- DietPi-Banner | Added a new option to show the Let's Encrypt certificate status (expiry date), when installed via dietpi-letsencrypt or Certbot. Many thanks to @gary2002 for implementing this option: https://github.com/MichaIng/DietPi/pull/6314 Bug fixes: - General | Resolved an issue where our recent images had the cron service masked accidentally after first run setup. Many thanks to @Johannes for reporting this issue: https://dietpi.com/forum/t/cron-service-is-masked/16544 diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 2444d6ea76..904865770a 100755 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -56,15 +56,15 @@ 'VPN status' 'Large hostname' 'Print credits' - + 'Let'\''s Encrypt cert status' ) # Set defaults: Disable CPU temp by default in VMs if (( $G_HW_MODEL == 20 )) then - aENABLED=(1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1) + aENABLED=(1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 0) else - aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1) + aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0) fi COLOUR_RESET='\e[0m' @@ -74,7 +74,6 @@ '\e[1m' # Bold white | Main descriptions '\e[90m' # Grey | Credits '\e[91m' # Red | Update notifications - ) # Load settings here, to have chosen ${aCOLOUR[0]} applied to below strings @@ -90,32 +89,29 @@ # DietPi update available? AVAILABLE_UPDATE= # value = version string - Check_DietPi_Update(){ - + Check_DietPi_Update() + { [[ -f '/run/dietpi/.update_available' ]] || return 1 AVAILABLE_UPDATE=$(&1)" - # LAN IP [5] + # LAN IP Print_Local_Ip # WAN IP + location info (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(G_GET_WAN_IP 2>&1)" @@ -263,6 +253,18 @@ $GREEN_LINE" (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" # Weather (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 3 'https://wttr.in/?format=4' 2>&1)" + # Let's Encrypt cert status + if (( ${aENABLED[16]} == 1 )) + then + local i certinfo='No certificate found' + for i in /etc/letsencrypt/live/*/cert.pem + do + [[ -f $i ]] || continue + certinfo=$(openssl x509 -enddate -noout -in "$i" | mawk '/notAfter=/{print "Valid until "$4"-"substr($1,10)"-"$2" "$3}' 2>&1) + break + done + echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[16]} $GREEN_SEPARATOR $certinfo" + fi # Custom (( ${aENABLED[10]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash "$FP_CUSTOM" 2>&1)" # MOTD @@ -278,11 +280,10 @@ $GREEN_LINE" (( ${aENABLED[15]} == 1 )) && Print_Credits Print_Updates (( ${aENABLED[11]} == 1 )) && Print_Useful_Commands - } - Menu_Main(){ - + Menu_Main() + { G_WHIP_CHECKLIST_ARRAY=() for i in "${!aDESCRIPTION[@]}" do @@ -320,7 +321,6 @@ NB: It is executed as bash script, so it needs to be in bash compatible syntax. [[ -f $FP_CUSTOM ]] || aENABLED[10]=0 Save > "$FP_SAVEFILE" - } #/////////////////////////////////////////////////////////////////////////////////////