From 5cb97d0fee8745afdf96f16b6c3c05f70e50a508 Mon Sep 17 00:00:00 2001 From: developomp Date: Sat, 9 Oct 2021 10:55:35 +0900 Subject: [PATCH] chagned paru build location, removed remove_essentials, added internet connection check, added exit 0 just in case --- setup.sh | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/setup.sh b/setup.sh index d5dfcc8..8062e8f 100755 --- a/setup.sh +++ b/setup.sh @@ -48,6 +48,14 @@ title() { echo -e "$BOLD$GREEN====================[ $* ]====================$RESET" } +smart_mkdir() { + # make directory recursively if it doesn't exist already + + if [ ! -d "$1" ]; then + mkdir -p "$1" + fi +} + package_install() { paru -S --noconfirm "$@" } @@ -66,11 +74,11 @@ backup() { install_paru() { log "installing paru" - cd /tmp || (error "failed to move to /tmp for paru installation" && exit 1) + smart_mkdir "$SCRIPT_DIR/tmp" + cd "$SCRIPT_DIR/tmp" || (error "failed to move to $SCRIPT_DIR/tmp for paru installation" && exit 1) sudo pacman --noconfirm -S --needed base-devel git git clone https://aur.archlinux.org/paru.git cd ./paru && makepkg -si - cd .. && rm -rf ./paru cd "$SCRIPT_DIR" || (error "failed to come back to working directory after installing paru" && exit 1) } @@ -85,18 +93,6 @@ setup_essentials() { # enable multilib, color, parallel download, and total download in /etc/pacman.conf } -remove_essentials() { - package_remove \ - epiphany \ - totem \ - kvantum-qt5 \ - gnome-firmware \ - gnome-color-manager \ - manjaro-hello \ - gnome-layout-switcher \ - -} - # #################### [ DEFINING SETUP ] #################### # Define instructions on how to setup applications & stuff @@ -628,6 +624,13 @@ if [[ ! $EUID -ne 0 ]]; then exit 1 fi +# check internet connection +if ! ping -c 1 archlinux.org &> /dev/null; then + error "You are not connected to the internet" +fi + +exit 1 + # check partition # check if $RESET$BOLD/media/pomp/data$GREEN exists in fstab and is mounted @@ -701,8 +704,6 @@ choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) clear for choice in $choices; do case "$choice" in - "remove_unnecessary_packages") - remove_essentials;; "4k_video_downloader") setup_4kvideodownloader;; "brave") @@ -782,3 +783,5 @@ if [ ! ${#POST_INSTALL[@]} -eq 0 ]; then log_no_label " - $doWhat" done fi + +exit 0