mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 04:06:54 +00:00
Update uupdump_creator.sh
This commit is contained in:
parent
ac506425c5
commit
daa57c39f3
@ -42,22 +42,41 @@ show_proxmenux_logo
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DEPS=(curl aria2 cabextract wimlib-imagex genisoimage chntpw)
|
|
||||||
CHECK_CMDS=(curl aria2c cabextract wimlib-imagex genisoimage chntpw)
|
|
||||||
NEEDED=()
|
|
||||||
|
|
||||||
for i in "${!CHECK_CMDS[@]}"; do
|
local DEPS=(curl aria2 cabextract wimtools genisoimage chntpw)
|
||||||
if ! command -v "${CHECK_CMDS[$i]}" &>/dev/null; then
|
local CMDS=(curl aria2c cabextract wimlib-imagex genisoimage chntpw)
|
||||||
NEEDED+=("${DEPS[$i]}")
|
local MISSING=()
|
||||||
|
local FAILED=()
|
||||||
|
|
||||||
|
for i in "${!CMDS[@]}"; do
|
||||||
|
if ! command -v "${CMDS[$i]}" &>/dev/null; then
|
||||||
|
MISSING+=("${DEPS[$i]}")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ ${#MISSING[@]} -gt 0 ]]; then
|
||||||
|
msg_info "$(translate "Installing dependencies: ${MISSING[*]}")"
|
||||||
|
apt-get update -qq >/dev/null 2>&1
|
||||||
|
if ! apt-get install -y "${MISSING[@]}" >/dev/null 2>&1; then
|
||||||
|
msg_error "$(translate "Failed to install: ${MISSING[*]}")"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in "${!CMDS[@]}"; do
|
||||||
|
if ! command -v "${CMDS[$i]}" &>/dev/null; then
|
||||||
|
FAILED+=("${CMDS[$i]}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ ${#FAILED[@]} -eq 0 ]]; then
|
||||||
|
msg_ok "$(translate "All dependencies installed and verified.")"
|
||||||
|
else
|
||||||
|
msg_error "$(translate "Missing commands after installation: ${FAILED[*]}")"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ ${#NEEDED[@]} -gt 0 ]]; then
|
|
||||||
msg_info "Installing dependencies: ${NEEDED[*]}"
|
|
||||||
apt-get update -qq >/dev/null
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y "${NEEDED[@]}" >/dev/null 2>&1
|
|
||||||
msg_ok "Dependencies successfully installed."
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user