Welcome to mirror list, hosted at ThFree Co, Russian Federation.

webmin.sh « apps - github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8e83510835d82c18b839ba5a31dde81faabf4db2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash

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

true
SCRIPT_NAME="Webmin"
SCRIPT_EXPLAINER="Webmin is a web-based interface for system administration for Unix.
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: \
https://webmin.com/standard.html"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)

# Check for errors + debug code and abort if something isn't right
# 1 = ON
# 0 = OFF
DEBUG=0
debug_mode

# Check if root
root_check

# Check if webmin is already installed
if ! is_this_installed webmin
then
    # Ask for installing
    install_popup "$SCRIPT_NAME"
else
    # Ask for removal or reinstallation
    reinstall_remove_menu "$SCRIPT_NAME"
    # Removal
    check_command apt-get purge webmin -y
    apt-get autoremove -y
    rm -f /etc/apt/sources.list.d/webmin.list
    rm -f /etc/apt/trusted.gpg.d/webmin.gpg
    sed -i '/webmin/d' /etc/apt/sources.list
    # Show successful uninstall if applicable
    removal_popup "$SCRIPT_NAME"
fi

# Install packages for Webmin
install_if_not apt-transport-https
install_if_not perl
install_if_not libnet-ssleay-perl
install_if_not openssl
install_if_not libauthen-pam-perl
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 zip

# https://github.com/webmin/webmin/issues/1169
apt-get clean all
apt-get update -q4 & spinner_loading

# Install Webmin
if ! curl_to_dir http://www.webmin.com "jcameron-key.asc" "$SCRIPTS"
then
    curl_to_dir https://gist.githubusercontent.com/enoch85/092c8f4c4f5127b99d40/raw/186333393163b7e0d50c8d3b25cae4d63ac78b22 "jcameron-key.asc" "$SCRIPTS"
fi
check_command apt-key --keyring /etc/apt/trusted.gpg.d/webmin.gpg add "$SCRIPTS/jcameron-key.asc"
rm -f "$SCRIPTS/jcameron-key.asc"
echo "deb https://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list
apt-get update -q4 & spinner_loading
install_if_not webmin

if ! dpkg-query -W -f='${Status}' "webmin" | grep -q "ok installed"
then
    wget http://prdownloads.sourceforge.net/webadmin/webmin_1.991_all.deb
    dpkg --install webmin_1.991_all.deb
fi

print_text_in_color "$ICyan" "Configuring Webmin..."
# redirect access on http to https
check_command systemctl stop webmin
# Redirect http to https on the LAN IP
check_command sed -i '/^ssl=.*/a ssl_redirect=1' /etc/webmin/miniserv.conf
check_command sed -i "/^port=.*/a host=$ADDRESS" /etc/webmin/miniserv.conf
start_if_stopped webmin

msg_box "Webmin is now installed and can be accessed from this address:

https://$ADDRESS:10000

You can log in with your Ubuntu CLI user: $UNIXUSER."

exit