diff --git a/docker.sh b/docker.sh index 2faf206..6341276 100644 --- a/docker.sh +++ b/docker.sh @@ -39,7 +39,7 @@ getImports() { } init_docker() { - if command_exists docker; then + if command -v docker >/dev/null 2>&1; 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 - run $_sudo apt-get update - run checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" + $_sudo apt-get update + checkAndInstall "docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin" } _fedora() { echo_info "executing fedora" sleep 2 - 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" + _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" } main() { @@ -125,15 +125,25 @@ main() { if getImports; then case "$1" in --silent | -s) - silent=true - echo_warning "Running the script silently.." + 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=false + if main; then + init_docker + fi ;; esac - - if main; then - init_docker - fi fi diff --git a/hyprland.sh b/hyprland.sh index 90c22fb..8d18900 100644 --- a/hyprland.sh +++ b/hyprland.sh @@ -36,6 +36,14 @@ getImports() { rm "$import" } +run(){ + if $silent; then + silentexec "$@" + else + "$@" + fi +} + askThings() { echo_note "Do you want to install hyprland? (y/N)" read -r askHyprland