From e04f449866e4c45a46918eacf26b8c03d2fcd3a8 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 6 Apr 2017 23:51:07 +0200 Subject: [PATCH] Revert "use nw_check.py" This reverts commit a638febb8db9b5fbe929eed35b33ea0d495b7dbc. --- Makefile | 5 ++--- bin/nw_check.in | 29 ----------------------------- bin/setup | 2 +- lib/util.sh | 4 ++-- 4 files changed, 5 insertions(+), 35 deletions(-) delete mode 100644 bin/nw_check.in diff --git a/Makefile b/Makefile index 30c266c..5ace962 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,9 @@ DATADIR = /share/manjaro-architect BIN = \ bin/btrfs-subvol-functions \ - bin/check-translate \ + bin/check-translate.in \ bin/ma-launcher \ - bin/manjaro-architect \ - bin/nw_check + bin/manjaro-architect LIBS = \ lib/ini_val.sh \ diff --git a/bin/nw_check.in b/bin/nw_check.in deleted file mode 100644 index 69d12f5..0000000 --- a/bin/nw_check.in +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 -# -# Architect Installation Framework (2016-2017) -# -# Written by Carl Duff and @mandog for Archlinux -# Heavily modified and re-written by @Chrysostomus to install Manjaro instead -# Contributors: @papajoker, @oberon, and the Manjaro-Community. -# -# This program is free software, provided under the GNU General Public License -# as published by the Free Software Foundation. So feel free to copy, distribute, -# or modify it as you wish. - -"""connectivity check, kindly contributed by @fhdk""" - -import sys -from urllib.request import urlopen - -remote_host = "https://manjaro.org" -maxwait = 2 -data = None -try: - data = urlopen(remote_host, timeout=maxwait) -except: - pass - -if data: - sys.exit(0) -else: - sys.exit(1) diff --git a/bin/setup b/bin/setup index f372e80..78f16df 100644 --- a/bin/setup +++ b/bin/setup @@ -12,7 +12,7 @@ [[ -e /run/miso/bootmnt ]] && setfont ter-116n -while ! nw_check; do +while [[ ! $(ping -c 2 manjaro.org) ]]; do if [[ $(cat /proc/1/comm) == "systemd" ]];then if [[ $(systemctl is-active NetworkManager) == "active" ]]; then dialog --backtitle ":: Manjaro Architect ::" --yesno "\nPlease connect to the internet:\n" 0 0 && \ diff --git a/lib/util.sh b/lib/util.sh index 6e730aa..e2ae064 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -341,7 +341,7 @@ set_keymap() { } mk_connection() { - if ! nw_check; then + if [[ ! $(ping -c 2 google.com) ]]; then DIALOG " $_NoCon " --yesno "\n$_EstCon\n " 0 0 && $NW_CMD && return 0 || clear && exit 0 fi } @@ -358,7 +358,7 @@ check_requirements() { exit 1 fi - if ! nw_check; then + if [[ ! $(ping -c 1 google.com) ]]; then DIALOG " $_ErrTitle " --infobox "\n$_ConFailBody\n " 0 0 sleep 2 exit 1