Skip to content

Commit

Permalink
Merge pull request nightscout#26 from tzachi-dar/fix-freedns2
Browse files Browse the repository at this point in the history
Fix freedns2
  • Loading branch information
jamorham authored Nov 21, 2022
2 parents 85ce635 + 3077e0c commit 61affed
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
27 changes: 21 additions & 6 deletions ConfigureFreedns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions NS_Install2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down Expand Up @@ -93,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

0 comments on commit 61affed

Please sign in to comment.