From 6ac8e30753da7aa543fba5325868b06d23660e7e Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Mon, 20 Feb 2017 00:01:51 +0100 Subject: [PATCH] move setup script to separate package; https://github.com/Chrysostomus/manjaro-architect/issues/51 --- Makefile | 3 +-- bin/setup | 28 ++++++++++++++++++++++++++++ bin/setup.in | 4 ---- lib/util-menu.sh | 4 ++-- 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 bin/setup delete mode 100644 bin/setup.in diff --git a/Makefile b/Makefile index d5b5336..2d77bcf 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,7 @@ DATADIR = /share/manjaro-architect BIN = \ bin/btrfs-subvol-functions \ bin/ma-launcher \ - bin/manjaro-architect \ - bin/setup + bin/manjaro-architect LIBS = \ lib/util.sh \ diff --git a/bin/setup b/bin/setup new file mode 100644 index 0000000..f8cd087 --- /dev/null +++ b/bin/setup @@ -0,0 +1,28 @@ +#!/bin/sh + +if [ $(cat /proc/1/comm) == "systemd" ]; then + H_INIT="systemd" +fi + +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 && \ + clear && nmtui && continue || \ + clear && exit 0 + else + dialog --backtitle ":: Manjaro Architect ::" --title " Error: " --msgbox "\nNo network service detected!\nquitting." 0 0 && \ + clear && exit 0 + fi + else + dialog --title " Error: " --msgbox "\nAn active internet connection is needed!\n" 0 0 && \ + clear && exit 0 + fi +done + +echo "updating the installer ..." +sleep 1 +sudo pacman -Sy manjaro-architect --noconfirm + +echo "launching Manjaro Architect ..." +sudo manjaro-architect diff --git a/bin/setup.in b/bin/setup.in deleted file mode 100644 index be1856c..0000000 --- a/bin/setup.in +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sudo manjaro-architect - diff --git a/lib/util-menu.sh b/lib/util-menu.sh index 800a765..1c19279 100644 --- a/lib/util-menu.sh +++ b/lib/util-menu.sh @@ -158,7 +158,7 @@ config_base_menu() { local PARENT="$FUNCNAME" # Set the default PATH variable - arch_chroot "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl" 2>/tmp/.errlog + arch_chroot "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl" 2>$ERR check_for_error submenu 8 @@ -278,7 +278,7 @@ install_acc_menu() { clear # If something has been selected, install if [[ $(cat ${PACKAGES}) != "" ]]; then - basestrap ${MOUNTPOINT} ${PACKAGES} 2>/tmp/.errlog + basestrap ${MOUNTPOINT} ${PACKAGES} 2>$ERR check_for_error fi