Add internet connectivity check

This commit is contained in:
Nico Jensch 2020-12-15 18:32:19 +01:00
parent 4c0ed983bf
commit 8e5394cd1c
1 changed files with 30 additions and 1 deletions

View File

@ -1,4 +1,13 @@
#!/bin/bash
function goto
{
label=$1
cmd=$(sed -n "/^:[[:blank:]][[:blank:]]*${label}/{:a;n;p;ba};" $0 |
grep -v ':$')
eval "$cmd"
exit
}
function upgrade2ultimate
{
rm -rf /tmp/setup-assistant
@ -701,6 +710,26 @@ systemctl --user start psd >/dev/null 2>&1 &
libinput-gestures-setup autostart >/dev/null 2>&1 &
libinput-gestures-setup start >/dev/null 2>&1 &
: isup
wget -q --spider http://garudalinux.org
if [ $? -eq 0 ]; then
echo "Online"
else
if ! yad \
--image='update' \
--title="Setup Assistant" \
--window-icon='update' \
--geometry=700x100 \
--button=No:0 \
--button=Yes:1 \
--text-align=center \
--center \
--text "No internet connection available, try again?"; then
goto isup
else exit
fi
fi
if ! yad \
--image='update' \
@ -712,7 +741,7 @@ if ! yad \
--text-align=center \
--center \
--text "Do you want to get a recent mirrorlist?"; then
reflector-simple >/dev/null 2>&1
reflector-simple >/dev/null 2>&1
fi
if ! yad \