From e6770edddae58e84f0d4d432c91c35242d5a5372 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Tue, 19 May 2020 11:10:06 +0200 Subject: [PATCH] Solved some bugs --- scripts/client/check.sh | 6 ++++-- scripts/client/setup.sh | 16 ++++++++-------- scripts/image/backup.sh | 4 +++- scripts/image/base.sh | 2 ++ scripts/image/chroot.sh | 1 + scripts/image/setup.sh | 4 +++- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/scripts/client/check.sh b/scripts/client/check.sh index 5629bf6..7fc5768 100644 --- a/scripts/client/check.sh +++ b/scripts/client/check.sh @@ -2,11 +2,13 @@ # @author Kevin Veen-Birkenbach # shellcheck source=/dev/null # Deactivate SC1090 source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) -echo "System check" +echo "System check - Shows things which can be optimized:" echo info "Checking relevant home folders for duplicated files..." fdupes -r "$HOME/Documents/" "$HOME/Downloads/" "$HOME/Images/" "$HOME/Desktop/" "$HOME/Music/" "$HOME/Pictures/" "$HOME/Videos" info "Searching for files which are in \"$HOME\" but don't belong to user \"$USER\"..." sudo find "$HOME" ! -user "$USER" -info "Searching for files which are in \"$HOME\" and bigger then 100MB..." +info "Searching for files which are in \"$HOME\" and bigger then 100MB..." find ~ -type f -size +100M -exec ls -lh {} \; +info "Showing the installed Java versions..." && +archlinux-java status diff --git a/scripts/client/setup.sh b/scripts/client/setup.sh index eec5625..1ff70b3 100644 --- a/scripts/client/setup.sh +++ b/scripts/client/setup.sh @@ -67,8 +67,13 @@ if [ ! -f "$ssh_key_path" ]; then fi fi -info "Installing nonfree drivers..." && -sudo mhwd -a pci nonfree 0300 || error +question "Should nonfree drivers be installed?(y/N)" && read -r install_nonfree_drivers +if [ "$install_nonfree_drivers" = "y" ] + then + info "Installing nonfree drivers..." && + sudo mhwd -a pci nonfree 0300 || error + warning "Nonfree drivers had been installed. This can lead to unexpected side effects!" +fi info "Setup, configuration and installation of dependencies for installed software..." @@ -102,7 +107,7 @@ fi if [ ! "$(pacman -Qi "virtualbox")" ] ; then info "Setting up virtualbox..." && - pamac install virtualbox "$(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-host-modules"}' ORS=' ')" && + sudo pacman -S virtualbox "$(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-host-modules"}' ORS=' ')" && sudo vboxreload && pamac build virtualbox-ext-oracle && sudo gpasswd -a "$USER" vboxusers || error @@ -203,10 +208,5 @@ if [ "$(ls -A "$autostart_folder")" ] info "No startup entries found. Skipped removing." fi -info "Showing the installed Java versions..." && -archlinux-java status && -info "Keep in mind to set the right Java-Version if it's neccessary." || -error - info "Please restart the computer, so that all updates get applied." success "Setup finished successfully :)" && exit 0 diff --git a/scripts/image/backup.sh b/scripts/image/backup.sh index c59e480..d29abb4 100644 --- a/scripts/image/backup.sh +++ b/scripts/image/backup.sh @@ -1,7 +1,9 @@ #!/bin/bash -# shellcheck disable=SC2010 +# shellcheck disable=SC2010 # ls | grep allowed # shellcheck disable=SC2015 # Deactivating bool hint # shellcheck source=/dev/null # Deactivate SC1090 +# shellcheck disable=SC2154 # Deactivate not referenced link +# shellcheck disable=SC2015 # Deactivate bools hints source "$(dirname "$(readlink -f "${0}")")/base.sh" || (echo "Loading base.sh failed." && exit 1) info "Backupscript for memory devices started..." echo diff --git a/scripts/image/base.sh b/scripts/image/base.sh index 25d34b6..45e9032 100644 --- a/scripts/image/base.sh +++ b/scripts/image/base.sh @@ -3,7 +3,9 @@ # Offers base functions for the image management # # shellcheck disable=SC2034 #Deactivate checking of unused variables +# shellcheck disable=SC2010 # ls | grep allowed # shellcheck source=/dev/null # Deactivate SC1090 +# shellcheck disable=SC2015 # Deactivate bools hints source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) # Writes the full partition name diff --git a/scripts/image/chroot.sh b/scripts/image/chroot.sh index b63af77..8a4e9ff 100644 --- a/scripts/image/chroot.sh +++ b/scripts/image/chroot.sh @@ -1,6 +1,7 @@ #!/bin/bash # shellcheck source=/dev/null # Deactivate SC1090 # shellcheck disable=SC2015 # Deactivating bool hint +# shellcheck disable=SC2154 # Deactivate not referenced link source "$(dirname "$(readlink -f "${0}")")/base.sh" || (echo "Loading base.sh failed." && exit 1) info "Starting chroot..." diff --git a/scripts/image/setup.sh b/scripts/image/setup.sh index d7bcee8..0432701 100644 --- a/scripts/image/setup.sh +++ b/scripts/image/setup.sh @@ -1,6 +1,8 @@ #!/bin/bash # shellcheck disable=SC2010 # ls | grep allowed # shellcheck source=/dev/null # Deactivate SC1090 +# shellcheck disable=SC2015 # Deactivate bools hints +# shellcheck disable=SC2154 # Deactivate not referenced link source "$(dirname "$(readlink -f "${0}")")/base.sh" || (echo "Loading base.sh failed." && exit 1) info "Setupscript for images started..." @@ -172,7 +174,7 @@ info "Generating os-image..." download_url="$base_download_url$imagename" image_path="$image_folder$imagename" -question "Should the image download be forced?(y/n)" && read -r force_image_download +question "Should the image download be forced?(y/N)" && read -r force_image_download if [ "$force_image_download" = "y" ] then if [ -f "$image_path" ]