From 772cc70675e93c656091fa8bb3e2ea0b2c227fcf Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 6 Apr 2025 21:01:21 +0200 Subject: [PATCH] wip --- setup/postinstall.sh | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/setup/postinstall.sh b/setup/postinstall.sh index 61e1236..0f301eb 100755 --- a/setup/postinstall.sh +++ b/setup/postinstall.sh @@ -53,30 +53,30 @@ 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.." - pkger="$pkg" - fi - done -} +# checkPkg() { +for pkg in apt-get dnf pacman apk zypper; do + if command_exists $pkg; then + printf "Using ${RED}${pkg}${NC} method.." + pkger="$pkg" + fi +done +# } # ─────────────────────────────────< check for root/sudo >─────────────────────────────── -checkRoot() { - if [ "$(id -u)" -ne 0 ]; then - if command_exists sudo; then - echo_info "User is not root. Using sudo for privileged operations." - _sudo="sudo -E" - else - echo_error "No sudo found and you're not root! Can't install packages." - return 1 - fi +# checkRoot() { +if [ "$(id -u)" -ne 0 ]; then + if command_exists sudo; then + echo_info "User is not root. Using sudo for privileged operations." + _sudo="sudo -E" else - echo_info "Root access confirmed." - _sudo="" + echo_error "No sudo found and you're not root! Can't install packages." + return 1 fi -} +else + echo_info "Root access confirmed." + _sudo="" +fi +# } # ╭─────╮ # │ apt │ @@ -225,10 +225,10 @@ zypperBase() { # │ FUNCTIONS │ # ╰───────────╯ -envCheck() { - checkRoot - checkPkg -} +# envCheck() { +# checkRoot +# checkPkg +# } install_base() { envCheck