diff --git a/setup/postinstall.sh b/setup/postinstall.sh index 5bff726..82b3544 100755 --- a/setup/postinstall.sh +++ b/setup/postinstall.sh @@ -53,16 +53,18 @@ command_exists() { } # ─────────────────────────────────────< get packager >───────────────────────────────────── -# checkPkg() { -for pkg in apt-get dnf pacman apk zypper; do - if command_exists $pkg; then - printf "Using ${RED}${pkg}${NC} method.." - export pkger="$pkg" +checkPkg() { + pkger="" + for pkg in apt-get dnf pacman apk zypper; do + if command_exists $pkg; then + printf "Using ${RED}${pkg}${NC} method.." + pkger="$pkg" - break - fi -done -# } + # break + return 0 + fi + done +} # ─────────────────────────────────< check for root/sudo >─────────────────────────────── # checkRoot() { @@ -228,12 +230,14 @@ zypperBase() { # ╰───────────╯ # envCheck() { -# checkRoot -# checkPkg +# checkRoot +# checkPkg # } install_base() { - # envCheck + if ! checkPkg; then + return 1 + fi echo_info "Installing base packages..." case "$pkger" in @@ -258,7 +262,9 @@ install_base() { } optimize_os() { - # envCheck + if ! checkPkg; then + return 1 + fi echo_info "Running OS optimizations..." case "$pkg" in