From 0bf3d5bd1d1de9a1ee17ed3fadb1f0a2ca7fd087 Mon Sep 17 00:00:00 2001 From: piezzo Date: Fri, 27 Jul 2018 15:42:09 +0200 Subject: [PATCH] extend LCD dialog to show ipv6 addresses correctly If your network is ipv6 only, $l2 will be trapped and the address truncated. As a result, $l3 is also not shown. This adjusts the width of the box. --- home.admin/00infoLCD.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/home.admin/00infoLCD.sh b/home.admin/00infoLCD.sh index 7fd2aa6..7a7bd51 100755 --- a/home.admin/00infoLCD.sh +++ b/home.admin/00infoLCD.sh @@ -29,7 +29,8 @@ if [ "$USER" = "pi" ]; then l1="Login to your RaspiBlitz with:\n" l2="ssh admin@${localip}\n" l3="Use password: raspiblitz\n" - dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 34 + boxwidth=$((${#localip} + 20)) + dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth} sleep 5 elif [ ${setupStep} -lt 100 ]; then @@ -45,7 +46,8 @@ if [ "$USER" = "pi" ]; then l1="!!! LND WALLET IS LOCKED !!!\n" l2="Login: ssh admin@${localip}\n" l3="Use your Password A\n" - dialog --backtitle "RaspiBlitz - Action Required" --infobox "$l1$l2$l3" 5 36 + boxwidth=$((${#localip} + 20)) + dialog --backtitle "RaspiBlitz - Action Required" --infobox "$l1$l2$l3" 5 ${boxwidth} sleep 5 elif [ ${lndSyncing} -gt 0 ]; then @@ -60,7 +62,8 @@ if [ "$USER" = "pi" ]; then l1="Login to your RaspiBlitz with:\n" l2="ssh admin@${localip}\n" l3="Use your Password A\n" - dialog --backtitle "RaspiBlitz - Setup Mode" --infobox "$l1$l2$l3" 5 34 + boxwidth=$((${#localip} + 20)) + dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth} sleep 10 fi @@ -77,7 +80,8 @@ if [ "$USER" = "pi" ]; then l1="!!! LND WALLET IS LOCKED !!!\n" l2="Login: ssh admin@${localip}\n" l3="Use your Password A\n" - dialog --backtitle "RaspiBlitz - Action Required" --infobox "$l1$l2$l3" 5 36 + boxwidth=$((${#localip} + 20)) + dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth} sleep 5 else