os-init/debian-11/apps/webmin/webmin.sh

18 lines
593 B
Bash
Raw Normal View History

2023-11-19 22:04:42 +00:00
#!/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