mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-02 11:03:03 +02:00
refactor: use shared get_lxc_ip and get_latest_github_release helpers in addon scripts
- pyenv.sh, webmin.sh, netdata.sh: replace manual hostname -I parsing with get_lxc_ip/$LOCAL_IP - phpmyadmin.sh: replace manual curl|grep|cut GitHub API version lookup with get_latest_github_release
This commit is contained in:
@@ -87,7 +87,8 @@ install() {
|
||||
$STD apt install -y netdata
|
||||
msg_ok "Installed ${APP}"
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "\n${APP} should be reachable at${BL} http://$(hostname -I | awk '{print $1}'):19999 ${CL}\n"
|
||||
get_lxc_ip
|
||||
echo -e "\n${APP} should be reachable at${BL} http://${LOCAL_IP}:19999 ${CL}\n"
|
||||
}
|
||||
|
||||
uninstall() {
|
||||
|
||||
@@ -112,11 +112,11 @@ function install_php_and_modules() {
|
||||
|
||||
function install_phpmyadmin() {
|
||||
msg_info "Fetching latest phpMyAdmin release from GitHub"
|
||||
LATEST_VERSION_RAW=$(curl -fsSL https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep tag_name | cut -d '"' -f4)
|
||||
LATEST_VERSION_RAW=$(get_latest_github_release "phpmyadmin/phpmyadmin" false) || true
|
||||
LATEST_VERSION=$(echo "$LATEST_VERSION_RAW" | sed -e 's/^RELEASE_//' -e 's/_/./g')
|
||||
if [[ -z "$LATEST_VERSION" ]]; then
|
||||
msg_error "Could not determine latest phpMyAdmin version from GitHub – falling back to 5.2.2"
|
||||
LATEST_VERSION="RELEASE_5_2_2"
|
||||
LATEST_VERSION="5.2.2"
|
||||
fi
|
||||
msg_ok "Latest version: $LATEST_VERSION"
|
||||
|
||||
@@ -217,7 +217,7 @@ function uninstall_phpmyadmin() {
|
||||
|
||||
function update_phpmyadmin() {
|
||||
msg_info "Fetching latest phpMyAdmin release from GitHub"
|
||||
LATEST_VERSION_RAW=$(curl -fsSL https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep tag_name | cut -d '"' -f4)
|
||||
LATEST_VERSION_RAW=$(get_latest_github_release "phpmyadmin/phpmyadmin" false) || true
|
||||
LATEST_VERSION=$(echo "$LATEST_VERSION_RAW" | sed -e 's/^RELEASE_//' -e 's/_/./g')
|
||||
|
||||
if [[ -z "$LATEST_VERSION" ]]; then
|
||||
|
||||
@@ -25,6 +25,7 @@ if command -v pveversion >/dev/null 2>&1; then
|
||||
msg_error "Can't Install on Proxmox "
|
||||
exit 1
|
||||
fi
|
||||
get_lxc_ip
|
||||
msg_info "Installing ${APP}"
|
||||
$STD apt update
|
||||
$STD apt install -y \
|
||||
@@ -90,7 +91,7 @@ EOF
|
||||
$STD pip3 install --pre homeassistant
|
||||
systemctl enable homeassistant &>/dev/null
|
||||
msg_ok "Installed Home Assistant Beta"
|
||||
echo -e " Go to $(hostname -I | awk '{print $1}'):8123"
|
||||
echo -e " Go to ${LOCAL_IP}:8123"
|
||||
hass
|
||||
fi
|
||||
|
||||
@@ -132,7 +133,7 @@ WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable --now esphomedashboard &>/dev/null
|
||||
msg_ok "Installed ESPHome Beta"
|
||||
echo -e " Go to $(hostname -I | awk '{print $1}'):6052"
|
||||
echo -e " Go to ${LOCAL_IP}:6052"
|
||||
exec $SHELL
|
||||
fi
|
||||
|
||||
|
||||
@@ -52,6 +52,6 @@ fetch_and_deploy_gh_release "webmin" "webmin/webmin" "binary" "latest" "/opt/web
|
||||
/usr/share/webmin/changepass.pl /etc/webmin root root &>/dev/null
|
||||
msg_ok "Installed ${APP}"
|
||||
|
||||
IP=$(hostname -I | cut -f1 -d ' ')
|
||||
echo -e "Successfully Installed!! ${APP} should be reachable by going to ${BL}https://${IP}:10000${CL}"
|
||||
get_lxc_ip
|
||||
echo -e "Successfully Installed!! ${APP} should be reachable by going to ${BL}https://${LOCAL_IP}:10000${CL}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user