mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-03 19:43:05 +02:00
refactor: harmonize architecture detection and improve installation scripts for addons
This commit is contained in:
+30
-38
@@ -5,6 +5,22 @@
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.webmin.com/ | Github: https://github.com/webmin/webmin
|
||||
|
||||
APP="Webmin"
|
||||
APP_TYPE="addon"
|
||||
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "webmin" "addon"
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
|
||||
# Initialize all core functions (colors, formatting, icons, STD mode)
|
||||
load_functions
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
@@ -15,51 +31,27 @@ function header_info {
|
||||
|
||||
EOF
|
||||
}
|
||||
set -eEuo pipefail
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
CM="${GN}✓${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
|
||||
msg_info() {
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||
}
|
||||
|
||||
msg_ok() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "webmin" "addon"
|
||||
|
||||
header_info
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Webmin Installer" --yesno "This Will Install Webmin on this LXC Container. Proceed?" 10 58
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} Installer" --yesno "This Will Install ${APP} on this LXC Container. Proceed?" 10 58
|
||||
|
||||
msg_info "Installing Prerequisites"
|
||||
apt update &>/dev/null
|
||||
apt-get -y install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl unzip shared-mime-info curl &>/dev/null
|
||||
$STD apt update
|
||||
$STD apt install -y \
|
||||
libnet-ssleay-perl \
|
||||
libauthen-pam-perl \
|
||||
libio-pty-perl \
|
||||
unzip \
|
||||
shared-mime-info \
|
||||
curl
|
||||
msg_ok "Installed Prerequisites"
|
||||
|
||||
LATEST=$(curl -fsSL https://api.github.com/repos/webmin/webmin/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
|
||||
msg_info "Downloading Webmin"
|
||||
curl -fsSL "https://github.com/webmin/webmin/releases/download/$LATEST/webmin_${LATEST}_all.deb" -o $(basename "https://github.com/webmin/webmin/releases/download/$LATEST/webmin_${LATEST}_all.deb")
|
||||
msg_ok "Downloaded Webmin"
|
||||
|
||||
msg_info "Installing Webmin"
|
||||
dpkg -i webmin_${LATEST}_all.deb &>/dev/null
|
||||
msg_info "Installing ${APP}"
|
||||
fetch_and_deploy_gh_release "webmin" "webmin/webmin" "binary" "latest" "/opt/webmin" "webmin_*_all.deb"
|
||||
/usr/share/webmin/changepass.pl /etc/webmin root root &>/dev/null
|
||||
rm -rf /root/webmin_${LATEST}_all.deb
|
||||
msg_ok "Installed Webmin"
|
||||
msg_ok "Installed ${APP}"
|
||||
|
||||
IP=$(hostname -I | cut -f1 -d ' ')
|
||||
echo -e "Successfully Installed!! Webmin should be reachable by going to ${BL}https://${IP}:10000${CL}"
|
||||
echo -e "Successfully Installed!! ${APP} should be reachable by going to ${BL}https://${IP}:10000${CL}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user