From 88604cb57a536c6760a778a492bf335bd968117b Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 3 Oct 2024 19:42:22 +0200 Subject: [PATCH] Update Webmin script --- apps/webmin.sh | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/apps/webmin.sh b/apps/webmin.sh index 9a7aa60..2ffd642 100644 --- a/apps/webmin.sh +++ b/apps/webmin.sh @@ -2,11 +2,10 @@ # T&M Hansson IT AB © - 2024, https://www.hanssonit.se/ -# shellcheck disable=2034,2059 true SCRIPT_NAME="Webmin" SCRIPT_EXPLAINER="Webmin is a web-based interface for system administration for Unix. -Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. +Using any modern web browser, you can set up user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, \ and lets you manage a system from the console or remotely. See the following page with standard modules for a list of all the functions built into Webmin: \ @@ -33,7 +32,13 @@ else reinstall_remove_menu "$SCRIPT_NAME" # Removal check_command apt-get purge webmin -y - rm -rf /etc/apt/sources.list.d/webmin.list + apt-get autoremove -y + rm -f /etc/apt/sources.list.d/webmin.list + rm -f /etc/apt/trusted.gpg.d/webmin.gpg + rm -f /etc/apt/keyrings/jcameron-key.asc + sed -i '/webmin/d' /etc/apt/sources.list + apt-get clean all + apt-get update # Show successful uninstall if applicable removal_popup "$SCRIPT_NAME" fi @@ -48,13 +53,37 @@ install_if_not libpam-runtime install_if_not libio-pty-perl install_if_not apt-show-versions install_if_not python2 +install_if_not unzip +install_if_not shared-mime-info +install_if_not zip + +# https://github.com/webmin/webmin/issues/1169 +apt-get clean all +apt-get update -q4 & spinner_loading # Install Webmin -if curl -fsSL http://www.webmin.com/jcameron-key.asc | sudo apt-key add - +if curl_to_dir http://www.webmin.com "jcameron-key.asc" /tmp +then + # Use the original key URL + add_trusted_key_and_repo "jcameron-key.asc" \ + "https://download.webmin.com" \ + "https://download.webmin.com/download/repository" \ + "sarge contrib" \ + "webmin.list" +else + # Use backup key URL + add_trusted_key_and_repo "jcameron-key.asc" \ + "https://gist.githubusercontent.com/enoch85/092c8f4c4f5127b99d40/raw/186333393163b7e0d50c8d3b25cae4d63ac78b22" \ + "https://download.webmin.com/download/repository" \ + "sarge contrib" \ + "webmin.list" +fi +install_if_not webmin + +if ! dpkg-query -W -f='${Status}' "webmin" | grep -q "ok installed" then - echo "deb https://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list - apt update -q4 & spinner_loading - install_if_not webmin + wget http://prdownloads.sourceforge.net/webadmin/webmin_2.010_all.deb + dpkg --install webmin_2.010_all.deb fi print_text_in_color "$ICyan" "Configuring Webmin..."