diff --git a/usr/bin/setup-assistant b/usr/bin/setup-assistant index 9f217bc..9d747a7 100755 --- a/usr/bin/setup-assistant +++ b/usr/bin/setup-assistant @@ -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 \