Sendmail access restricted only for: 127. 10.
[enbrace.git] / enbrace.bash
index 165205a..bd4d44d 100755 (executable)
@@ -117,6 +117,51 @@ EOF
 +# Moved in from "~/.cshrc"!
 +/root/status/message/hint
 EOF
+       cat >sendmail.diff <<EOF
+--- etc/rc.conf-orig   Fri Feb 22 12:40:54 2002
++++ etc/rc.conf        Tue Mar 12 15:14:38 2002
+@@ -132,7 +132,7 @@
+ cron_enable="YES"     # Run the periodic job daemon.
+ lpd_enable="NO"               # Run the line printer daemon.
+ lpd_flags=""          # Flags to lpd (if enabled).
+-sendmail_enable="YES" # Run the sendmail daemon (or NO).
++sendmail_enable="NO"  # Run the sendmail daemon (or NO).
+ sendmail_flags="-bd -q30m" # -bd is pretty mandatory.
+ dumpdev="NO"          # Device name to crashdump to (if enabled).
+ check_quotas="NO"     # Check quotas (or NO).
+--- etc/inetd.conf-orig        Tue Mar 12 15:15:35 2002
++++ etc/inetd.conf     Tue Mar 12 15:10:19 2002
+@@ -65,3 +65,6 @@
+ #
+ #netbios-ssn stream tcp nowait root /usr/local/sbin/smbd smbd 
+ #netbios-ns dgram udp wait root /usr/local/sbin/nmbd nmbd 
++
++# Jan Kolar <jan.kolar@jklabs.cz> /Lace
++smtp  stream  tcp     nowait  root    /usr/local/libexec/tcpd /usr/sbin/sendmail -bs
+--- /dev/null  Tue Mar 12 15:13:23 2002
++++ usr/local/etc/hosts.allow  Tue Mar 12 15:13:46 2002
+@@ -0,0 +1 @@
++sendmail : 127. 10.
+--- /dev/null  Tue Mar 12 15:13:23 2002
++++ usr/local/etc/hosts.deny   Tue Mar 12 15:11:50 2002
+@@ -0,0 +1 @@
++sendmail : ALL
+--- etc/crontab-orig   Wed Oct 22 00:21:08 1997
++++ etc/crontab        Tue Mar 12 15:18:42 2002
+@@ -23,3 +23,6 @@
+ # does nothing, if you have UTC cmos clock.
+ # See adjkerntz(8) for details.
+ 1,31  0-4     *       *       *       root    /sbin/adjkerntz -a
++
++# Jan Kolar <jan.kolar@jklabs.cz> /Lace
++*/30  *       *       *       *       root    /usr/sbin/sendmail -q
+EOF
+
+# Sendmail
+       (cd /
+               patch -sEp0 </root/enbrace/sendmail.diff
+               )
+       set +e;killall sendmail;set -e
 
 # OpenSSL
        ftpget "$openssl"
@@ -153,6 +198,9 @@ EOF
        patch /root/.cshrc <root-cshrc.diff
        patch /root/.login <root-login.diff
 
+# Sendmail-post
+       set +e;killall -HUP inetd;set -e
+
 # OpenSSH-post
        for i in /usr/local/etc/*_key;do
                echo -n "$i: ";/usr/local/bin/ssh-keygen -l -f $i