18 lines
593 B
Bash
18 lines
593 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
echo "deb https://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list
|
||
|
wget https://download.webmin.com/jcameron-key.asc
|
||
|
cat jcameron-key.asc | gpg --dearmor >/etc/apt/trusted.gpg.d/jcameron-key.gpg
|
||
|
|
||
|
apt update
|
||
|
apt-get -y install webmin
|
||
|
|
||
|
systemctl daemon-reload
|
||
|
systemctl start webmin
|
||
|
|
||
|
if [ -f "/etc/iptables/rules.v4" ]; then
|
||
|
sed -i '/^COMMIT.*/i # Webmin' /etc/iptables/rules.v4
|
||
|
sed -i '/^COMMIT.*/i -A INPUT -p tcp -m tcp --dport 10000 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||
|
iptables-restore /etc/iptables/rules.v4
|
||
|
fi
|