wip
This commit is contained in:
parent
81701228fd
commit
772cc70675
1 changed files with 24 additions and 24 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue