Skip to content

Commit 88604cb

Browse files
authored
Update Webmin script
1 parent 396f005 commit 88604cb

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

apps/webmin.sh

+36-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
# T&M Hansson IT AB © - 2024, https://www.hanssonit.se/
44

5-
# shellcheck disable=2034,2059
65
true
76
SCRIPT_NAME="Webmin"
87
SCRIPT_EXPLAINER="Webmin is a web-based interface for system administration for Unix.
9-
Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more.
8+
Using any modern web browser, you can set up user accounts, Apache, DNS, file sharing and much more.
109
Webmin removes the need to manually edit Unix configuration files like /etc/passwd, \
1110
and lets you manage a system from the console or remotely.
1211
See the following page with standard modules for a list of all the functions built into Webmin: \
@@ -33,7 +32,13 @@ else
3332
reinstall_remove_menu "$SCRIPT_NAME"
3433
# Removal
3534
check_command apt-get purge webmin -y
36-
rm -rf /etc/apt/sources.list.d/webmin.list
35+
apt-get autoremove -y
36+
rm -f /etc/apt/sources.list.d/webmin.list
37+
rm -f /etc/apt/trusted.gpg.d/webmin.gpg
38+
rm -f /etc/apt/keyrings/jcameron-key.asc
39+
sed -i '/webmin/d' /etc/apt/sources.list
40+
apt-get clean all
41+
apt-get update
3742
# Show successful uninstall if applicable
3843
removal_popup "$SCRIPT_NAME"
3944
fi
@@ -48,13 +53,37 @@ install_if_not libpam-runtime
4853
install_if_not libio-pty-perl
4954
install_if_not apt-show-versions
5055
install_if_not python2
56+
install_if_not unzip
57+
install_if_not shared-mime-info
58+
install_if_not zip
59+
60+
# https://github.com/webmin/webmin/issues/1169
61+
apt-get clean all
62+
apt-get update -q4 & spinner_loading
5163

5264
# Install Webmin
53-
if curl -fsSL http://www.webmin.com/jcameron-key.asc | sudo apt-key add -
65+
if curl_to_dir http://www.webmin.com "jcameron-key.asc" /tmp
66+
then
67+
# Use the original key URL
68+
add_trusted_key_and_repo "jcameron-key.asc" \
69+
"https://download.webmin.com" \
70+
"https://download.webmin.com/download/repository" \
71+
"sarge contrib" \
72+
"webmin.list"
73+
else
74+
# Use backup key URL
75+
add_trusted_key_and_repo "jcameron-key.asc" \
76+
"https://gist.githubusercontent.com/enoch85/092c8f4c4f5127b99d40/raw/186333393163b7e0d50c8d3b25cae4d63ac78b22" \
77+
"https://download.webmin.com/download/repository" \
78+
"sarge contrib" \
79+
"webmin.list"
80+
fi
81+
install_if_not webmin
82+
83+
if ! dpkg-query -W -f='${Status}' "webmin" | grep -q "ok installed"
5484
then
55-
echo "deb https://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list
56-
apt update -q4 & spinner_loading
57-
install_if_not webmin
85+
wget http://prdownloads.sourceforge.net/webadmin/webmin_2.010_all.deb
86+
dpkg --install webmin_2.010_all.deb
5887
fi
5988

6089
print_text_in_color "$ICyan" "Configuring Webmin..."

0 commit comments

Comments
 (0)