diff --git a/docker.sh b/docker.sh index 6341276..2faf206 100644 --- a/docker.sh +++ b/docker.sh @@ -39,7 +39,7 @@ getImports() { } init_docker() { - if command -v docker >/dev/null 2>&1; then + if command_exists docker; then echo_info "Docker was installed correctly. Do you want to add $(whoami) to the docker group? (y/n)" read -r dgroup /dev/null echo_info "Addet repository. Updating and installing now.." sleep 0.5 - $_sudo apt-get update - checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" + run $_sudo apt-get update + run checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" } _fedora() { echo_info "executing fedora" sleep 2 - _install dnf-plugins-core - $_sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo - checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" + run _install dnf-plugins-core + run $_sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo + run checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" } main() { @@ -125,25 +125,15 @@ main() { if getImports; then case "$1" in --silent | -s) - echo_warning "Executing silently!" - echo_info "Executing $distro" - case "$distro" in - arch) silentexec _arch ;; - debian) silentexec _debian ;; - ubuntu) silentexec _ubuntu ;; - fedora) silentexec _fedora ;; - *) - echo "$distro is not supported by this script" - exit 1 - ;; - esac - - init_docker + silent=true + echo_warning "Running the script silently.." ;; *) - if main; then - init_docker - fi + silent=false ;; esac + + if main; then + init_docker + fi fi diff --git a/hyprland.sh b/hyprland.sh index 8d18900..90c22fb 100644 --- a/hyprland.sh +++ b/hyprland.sh @@ -36,14 +36,6 @@ getImports() { rm "$import" } -run(){ - if $silent; then - silentexec "$@" - else - "$@" - fi -} - askThings() { echo_note "Do you want to install hyprland? (y/N)" read -r askHyprland