#!/bin/sh
# /etc/init.d/kx_dienste.sh
# Per ``dialog'' abfragen, welche Dienste gestartet werden sollen?
rm -f /tmp/dienste.txt
dialog -backtitle Auswahl -title Dienste \
-checklist "Welche Dienste sollen gestartet werden?" 15 60 10 \
"Firewall" "(iptables)" on \
"Anti-Spoofing & NAT" "(Versuch 4)" off \
"VPN" "FreeS/Wan, ipsec)" off \
"Nameserver" "(named)" off \
"Proxy" "(squid)" off \
"Telnet-&SSH-Server" "(telnetd/sshd)" off \
"Mailserver" "(sendmail)" off \
"Webserver" "(apache)" off \
"Socks" "(dante-client)" off \
"IDS" "(snort)" off \ 2> /tmp/dienste.txt
if [ `cat /tmp/dienste.txt | grep -c "Firewall"` -eq "1" ]; then
echo "Starte Firewall"
/etc/init.d/kx_fw_dyn.sh start
fi
if [ `cat /tmp/dienste.txt | grep -c "Anti-Spoofing & NAT"` -eq "1" ]; then
echo "Starte Anti-Spoofing und NAT"
/etc/init.d/kx_fw_nat.sh start
fi
if [ `cat /tmp/dienste.txt | grep -c "VPN"` -eq "1" ]; then
echo "Starte VPN"
/etc/init.d/kx_vpn.sh start
/etc/init.d/ipsec stop
/etc/init.d/ipsec start
fi
if [ `cat /tmp/dienste.txt | grep -c "Nameserver"` -eq "1" ]; then
echo "Starte Nameserver"
/etc/init.d/kx_fw_dyn.sh stop
/etc/init.d/kx_named.conf.options.sh
/etc/init.d/kx_named.conf.sh
/etc/init.d/bind stop
/etc/init.d/bind start
/etc/init.d/kx_resolv.conf_named.sh
fi
if [ `cat /tmp/dienste.txt | grep -c "Proxy"` -eq "1" ]; then
echo "Starte Proxy (und schalte vorher Firewall aus)"
/etc/init.d/kx_fw_dyn.sh stop
/etc/init.d/kx_squid.sh
/etc/init.d/squid start
fi
if [ `cat /tmp/dienste.txt | grep -c "Telnet-&SSH-Server"` -eq "1" ]; then
echo "Starte Telnet- & SSH-Server"
/etc/init.d/kx_telnetssh.sh
fi
if [ `cat /tmp/dienste.txt | grep -c "Mailserver"` -eq "1" ]; then
echo "Starte Mailserver"
/etc/init.d/kx_mail_mailertable.sh
/etc/init.d/sendmail start
fi
if [ `cat /tmp/dienste.txt | grep -c "Webserver"` -eq "1" ]; then
echo "Starte Webserver"
/etc/init.d/apache start
fi
if [ `cat /tmp/dienste.txt | grep -c "Socks"` -eq "1" ]; then
echo "Konfiguriere Socks-Client"
/etc/init.d/kx_socks.sh
fi
if [ `cat /tmp/dienste.txt | grep -c "IDS"` -eq "1" ]; then
echo "Starte Snort"
/etc/init.d/snort start
fi