Skip to content

Commit

Permalink
Update dietpi/func/dietpi-banner
Browse files Browse the repository at this point in the history
Happy with that.

Co-authored-by: MichaIng <[email protected]>
  • Loading branch information
gary2002 and MichaIng authored Apr 16, 2023
1 parent 197abe4 commit 7e53f2f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dietpi/func/dietpi-banner
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,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)"
# Certificate
local certinfo='No certificate found'
local letsencrypt=/etc/letsencrypt
if [[ -d "$letsencrypt" ]];
# Let's Encrypt cert status
if (( ${aENABLED[16]} == 1 ))
then
for i in "$letsencrypt"/live/*/cert.pem
local i certinfo='No certificate found'
for i in /etc/letsencrypt/live/*/cert.pem
do
certinfo=$(openssl x509 --enddate --noout --in "$i" | mawk '/notAfter=/{print substr($2,1) "-" substr($1,10) "-" substr($4,1) " @ " substr($3,1)}' 2>&1)
[[ -f $i ]] || continue
certinfo=$(openssl x509 --enddate --noout --in "$i" | mawk '/notAfter=/{print "Valid until " substr($2,1) "-" substr($1,10) "-" substr($4,1) " @ " substr($3,1)}' 2>&1)
break
done
echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[16]} $GREEN_SEPARATOR $certinfo"
fi
(( ${aENABLED[16]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[16]} $GREEN_SEPARATOR $certinfo"
# Custom
(( ${aENABLED[10]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash "$FP_CUSTOM" 2>&1)"
# MOTD
Expand Down

0 comments on commit 7e53f2f

Please sign in to comment.