summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbel Tim <git@abeltim.com>2025-06-01 16:15:53 +0200
committerAbel Tim <git@abeltim.com>2025-06-01 16:15:53 +0200
commitd4f9f233ca2e842efa78a4444f423710f1998530 (patch)
treeef4b2f8e84229127d58b79e1c2ac8d4b91e977f7
parent33accd2632d656bca22e479b8bf738f8ffcc5846 (diff)
downloadrobotica-d4f9f233ca2e842efa78a4444f423710f1998530.tar.gz
robotica-d4f9f233ca2e842efa78a4444f423710f1998530.zip
fixed option 3 actualy exiting, 2--> no sudo, says how to exit now, and check internet with ping no wget.
micro pushes becouse i need to download it on my other maching via the manual in the folder Signed-off-by: Abel Tim <git@abeltim.com>
-rw-r--r--setup/recoscript.sh5
-rw-r--r--setup/selectscript.sh8
-rw-r--r--setup/setupscr.sh1
3 files changed, 7 insertions, 7 deletions
diff --git a/setup/recoscript.sh b/setup/recoscript.sh
index d3911dd..7e00a25 100644
--- a/setup/recoscript.sh
+++ b/setup/recoscript.sh
@@ -4,11 +4,10 @@ user=user
pass=2235
#
#check internet connection
-wget -q --spider https://github.com
-if [ $? -eq 0 ]; then
+if ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null ; then
echo 'Internet connection found'
else
- echo 'Error, either your device is off-line or https://github.com is off-line.'
+ echo 'Error, either your device appears to be off-line.'
exit
fi
diff --git a/setup/selectscript.sh b/setup/selectscript.sh
index 837bf3e..9f0a1f9 100644
--- a/setup/selectscript.sh
+++ b/setup/selectscript.sh
@@ -3,15 +3,15 @@ echo 'Welkom to the robosoccer guided installment script!'
#check sudo
if [ `whoami` != root ]; then
- echo Please run this script as root or using sudo
+ echo "Please run this script as root or using sudo"
+ echo "To exit press Ctrl-c"
exit
fi
#check internet connection
-wget -q --spider https://github.com
-if [ $? -eq 0 ]; then
+if ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null ; then
echo 'Internet connection found'
else
- echo 'Error, either your device is off-line or https://github.com is off-line.'
+ echo 'Error, either your device appears to be off-line.'
exit
fi
diff --git a/setup/setupscr.sh b/setup/setupscr.sh
index 70d175d..1807d08 100644
--- a/setup/setupscr.sh
+++ b/setup/setupscr.sh
@@ -50,6 +50,7 @@ while true; do
sh -c "$(curl -sSL https://raw.githubusercontent.com/mendelcollege-robotics/robotica/refs/heads/main/setup/selectscript.sh)"
;;
3|e*|E*)
+ exit
;;
*)
echo 'Unrecognised input, please try again'