From f14e385e4cee65cd2f5a0048c2521723a33617ce Mon Sep 17 00:00:00 2001 From: Tzachi Dar Date: Sun, 20 Nov 2022 20:38:47 +0200 Subject: [PATCH 1/3] Use git instead of wget. --- bootstrap.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 8aab6bb285b..c2f9c0863e7 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -41,12 +41,16 @@ if [ ./update_scripts.sh ] then sudo rm update_scripts.sh fi +rm -fr nightscout-vps if [ $Test -gt 0 ] then wget https://raw.githubusercontent.com/Navid200/cgm-remote-monitor/Navid_2022_11_16_Test/update_scripts.sh # Test else -wget https://raw.githubusercontent.com/jamorham/nightscout-vps/vps-1/update_scripts.sh # Main +git clone https://github.com/jamorham/nightscout-vps.git nightscout-vps +cd nightscout-vps +git checkout vps-1 + fi if [ ! -s update_scripts.sh ] From 8212bb01435981b70ccc89edd972e16291168916 Mon Sep 17 00:00:00 2001 From: Tzachi Dar Date: Sun, 20 Nov 2022 11:41:35 +0200 Subject: [PATCH 2/3] Call certbot 4 times in order to avoid temporary network conditions. --- ConfigureFreedns.sh | 27 +++++++++++++++++++++------ NS_Install2.sh | 4 ++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ConfigureFreedns.sh b/ConfigureFreedns.sh index 5138878197a..121d566a443 100755 --- a/ConfigureFreedns.sh +++ b/ConfigureFreedns.sh @@ -177,14 +177,29 @@ while : ; do done #Fix the certificate using the new host name. -sudo certbot --nginx -d "$hostname" --redirect --agree-tos --no-eff-email -if [ ! -s /etc/letsencrypt/live/"$hostname"/cert.pem ] || [ ! -s /etc/letsencrypt/live/"$hostname"/privkey.pem ] -then + +for i in {1..4} +do + for j in {1..1000} + do + read -t 0.001 dummy + done + + sudo certbot --nginx -d "$hostname" --redirect --agree-tos --no-eff-email + + if [ ! -s /etc/letsencrypt/live/"$hostname"/cert.pem ] || [ ! -s /etc/letsencrypt/live/"$hostname"/privkey.pem ] + then + + echo freedns failed sleeping + sleep 60 + else + # worked, geting out of the loop. + exit 1 + fi +done cat > /tmp/FreeDNS_Failed << EOF Internal error. Must run FreeDNS again. EOF -dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\nInternal error. Press enter to exit. Then, run FreeDNS Setup again" 9 50 -fi - +dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\nInternal error. Press enter to exit. Then, run FreeDNS Setup again" 9 50 \ No newline at end of file diff --git a/NS_Install2.sh b/NS_Install2.sh index 879d28d3493..70fda4e0cca 100644 --- a/NS_Install2.sh +++ b/NS_Install2.sh @@ -120,9 +120,9 @@ echo "Current API secret is: $cs" echo echo "If you would like to change it please enter the new secret now or hit enter to leave the same" -for loop in 1 2 3 4 5 6 7 8 9 +for j in {1..1000} do -read -t 0.1 dummy +read -t 0.001 dummy done read -p "New secret 12 character minimum length (blank to skip change) : " ns From 3077e0c4a3ea88d087b42cc72a6a0f0f357426b6 Mon Sep 17 00:00:00 2001 From: Tzachi Dar Date: Mon, 21 Nov 2022 14:44:21 +0200 Subject: [PATCH 3/3] The bootstrap command will run the commands with redirection to /dev/tty --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index c2f9c0863e7..1cf6eb9fc6b 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -97,5 +97,5 @@ Please take a note, delete the virtual machine, and create a new one. For more # Bring up the status page /xDrip/scripts/Status.sh clear -/xDrip/scripts/menu.sh +/xDrip/scripts/menu.sh < /dev/tty