From e7b053bde2a483b9b077ee7437c358fdbdea93fd Mon Sep 17 00:00:00 2001 From: gutosie Date: Wed, 22 Apr 2020 21:55:01 +0300 Subject: [PATCH] Update userscript.sh --- NeoBoot/files/userscript.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/NeoBoot/files/userscript.sh b/NeoBoot/files/userscript.sh index 715c0bb..6f5aeda 100644 --- a/NeoBoot/files/userscript.sh +++ b/NeoBoot/files/userscript.sh @@ -21,8 +21,22 @@ fi echo "_(Checking internet connection)..." ping -c 1 github.com 1>/dev/null 2>%1 if [ $? -gt 0 ]; then - echo -n "_(github server unavailable, update impossible)!!! network restart... " + echo -n "_(github server unavailable, update impossible)!!! network restart... " /etc/init.d/networking stop; sleep 1; /etc/init.d/networking start; + if [ $? -gt 0 ]; then + if [ -e /usr/bin/curl ]; then + cd /tmp; curl -O --ftp-ssl https://raw.githubusercontent.com/gutosie/NeoBoot8/master/ver.txt; + cd / + elif [ -e /usr/bin/wget ]; then + wget https://raw.githubusercontent.com/gutosie/NeoBoot8/master/ver.txt -O /tmp/ver.txt + cd / + + fi + if [ ! -f /tmp/ver.txt ] ; then + /etc/init.d/networking stop; sync; /etc/init.d/networking start; + fi + fi + echo " dns-nameservers 1.1.1.1" >> /etc/network/interfaces else echo "_(github server available)!!!" fi