5 # cd;echo 'default login anonymous password short@' >~/.netrc;echo -e 'bi\nhash\npass\ncd pub/priv/short/enbrace\nget enbrace.bash\nquit'|ftp vellum.cz;/usr/local/bin/bash enbrace.bash
7 # Patch multi-application liable files:
8 # [cs_CZ] Soubory citlive na vicenasobnou aplikaci patche:
20 if [ "$USER" != "root" ];then fatal "This script must be run as 'root'" ;fi
21 if [ "$PWD" != "/root" ];then fatal "This script must be run from directory '/root'" ;fi
22 if [ "`basename "$0"`" != "enbrace.bash" ];then fatal "This script must be named 'enbrace.bash'" ;fi
23 if [ -e "enbrace" ];then fatal "'/root/enbrace' directory already exists" ;fi
29 login anonymous password short@
37 if [ $# != 1 ];then fatal "ftpget(): (arg1=URL) required!";fi
38 host="`echo "$1"|sed 's#^ftp://\([^/]*\)/.*$#\1#'`"
39 dir="` echo "$1"|sed 's#^ftp://[^/]*\(/.*/\)[^/]*$#\1#'`"
40 file="`echo "$1"|sed 's#^.*/\([^/]*\)$#\1#'`"
41 base="`basename "$file" .tar.gz`"
42 if gzip -t "../$file" 2>/dev/null;then
44 echo -n "Using already downloaded file \"$1\": ";ls -l "$file"
47 echo -e "cd \"$dir\"\\nget \"$file\"\\nquit"|ftp -v "$host"
56 openssl="ftp://ftp.openssl.org/source/openssl-0.9.6c.tar.gz"
57 openssh="ftp://ftp1.se.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-3.1p1.tar.gz"
70 cat >httpd.conf.diff <<EOF
71 --- httpd.conf-orig Fri Dec 17 01:39:20 1999
72 +++ httpd.conf Fri Aug 17 01:13:47 2001
76 #Allow from .your_domain.com
81 + Allow from 10.0.0.0/255.0.0.0
86 cat >rc.local.diff <<EOF
87 --- rc.local-orig Mon Sep 3 19:12:24 2001
88 +++ rc.local Mon Sep 3 19:15:48 2001
90 echo "Server Adminstration Program started...."
93 +# Jan Kolar <jan.kolar@jklabs.cz> /Lace
94 +echo "Starting OpenSSH service...."
96 +echo "OpenSSH service started...."
103 cat >root-cshrc.diff <<EOF
104 --- root/.cshrc-orig Fri Feb 26 21:11:13 1999
105 +++ root/.cshrc Mon Sep 10 22:37:31 2001
108 set local=\`ifconfig -a |grep inet |awk 'NR<2 {print \$2}'\`
109 set prompt="\`echo \$local\` [\`whoami\`] -\\! # "
110 -/root/status/message/hint
112 +# Jan Kolar <jan.kolar@jklabs.cz> /Lace
113 +# Commented-out, must be placed in "~/.login"!
114 +## /root/status/message/hint
116 cat >root-login.diff <<EOF
117 --- root/.login-orig Fri Feb 26 21:11:13 1999
118 +++ root/.login Mon Sep 10 22:37:52 2001
120 #set prompt="\`hostname\` [root] -\\! # "
121 set local=\`ifconfig -a |grep inet |awk 'NR<2 {print \$2}'\`
122 set prompt="\`echo \$local\` [\`whoami\`] -\\! # "
124 +# Jan Kolar <jan.kolar@jklabs.cz> /Lace
125 +# Moved in from "~/.cshrc"!
126 +/root/status/message/hint
128 cat >root-mail.diff <<EOF
129 --- /dev/null Fri Mar 15 02:04:08 2002
130 +++ root/.forward Fri Mar 15 04:30:57 2002
135 cat >sendmail.diff <<EOF
136 --- etc/rc.conf-orig Fri Feb 22 12:40:54 2002
137 +++ etc/rc.conf Tue Mar 12 15:14:38 2002
139 cron_enable="YES" # Run the periodic job daemon.
140 lpd_enable="NO" # Run the line printer daemon.
141 lpd_flags="" # Flags to lpd (if enabled).
142 -sendmail_enable="YES" # Run the sendmail daemon (or NO).
143 +sendmail_enable="NO" # Run the sendmail daemon (or NO).
144 sendmail_flags="-bd -q30m" # -bd is pretty mandatory.
145 dumpdev="NO" # Device name to crashdump to (if enabled).
146 check_quotas="NO" # Check quotas (or NO).
147 --- etc/inetd.conf-orig Tue Mar 12 15:15:35 2002
148 +++ etc/inetd.conf Tue Mar 12 15:10:19 2002
151 #netbios-ssn stream tcp nowait root /usr/local/sbin/smbd smbd
152 #netbios-ns dgram udp wait root /usr/local/sbin/nmbd nmbd
154 +# Jan Kolar <jan.kolar@jklabs.cz> /Lace
155 +smtp stream tcp nowait root /usr/local/libexec/tcpd /usr/sbin/sendmail -bs
156 --- /dev/null Tue Mar 12 15:13:23 2002
157 +++ usr/local/etc/hosts.allow Tue Mar 12 15:13:46 2002
160 --- /dev/null Tue Mar 12 15:13:23 2002
161 +++ usr/local/etc/hosts.deny Tue Mar 12 15:11:50 2002
164 --- etc/crontab-orig Wed Oct 22 00:21:08 1997
165 +++ etc/crontab Tue Mar 12 15:18:42 2002
167 # does nothing, if you have UTC cmos clock.
168 # See adjkerntz(8) for details.
169 1,31 0-4 * * * root /sbin/adjkerntz -a
171 +# Jan Kolar <jan.kolar@jklabs.cz> /Lace
172 +*/30 * * * * root /usr/sbin/sendmail -q
174 cat >openssh-3.1p1-i386-unknown-freebsd2.2.5.diff <<EOF
175 --- configure.ac-orig Thu Apr 4 00:35:36 2002
176 +++ configure.ac Thu Apr 4 00:35:45 2002
180 check_for_libcrypt_later=1
181 + AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
184 conf_lastlog_location="/usr/adm/lastlog"
185 --- configure-orig Thu Apr 4 00:35:55 2002
186 +++ configure Thu Apr 4 00:40:37 2002
187 @@ -3568,6 +3568,10 @@
190 check_for_libcrypt_later=1
191 + cat >>confdefs.h <<\_ACEOF
192 +#define HAVE_BOGUS_SYS_QUEUE_H 1
197 conf_lastlog_location="/usr/adm/lastlog"
198 --- defines.h-orig Wed Feb 27 03:40:49 2002
199 +++ defines.h Thu Apr 4 01:00:56 2002
201 including rpc/rpc.h breaks Solaris 6
203 #ifndef INADDR_LOOPBACK
204 -#define INADDR_LOOPBACK ((ulong)0x7f000001)
205 +#define INADDR_LOOPBACK ((unsigned long)0x7f000001)
213 patch -sENp0 </root/enbrace/sendmail.diff
215 set +e;killall sendmail;set -e
219 rm -rf /usr/local/openssl*
222 ./config --prefix=/usr/local --openssldir=/usr/local/"$base" 2>&1|tee errs1
224 make test 2>&1|tee errs2a
225 make install 2>&1|tee errs3
227 ln -s "$base" /usr/local/openssl
233 patch -sENp0 <../openssh-3.1p1-i386-unknown-freebsd2.2.5.diff
235 ./configure --with-ipv4-default \
236 --with-default-path="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin" \
239 make install 2>&1|tee errs3
241 patch -N /etc/rc.local <rc.local.diff
245 patch -N /usr/local/etc/httpd/conf/httpd.conf <httpd.conf.diff
246 # We need to temporarily disable error checking as killall(1) MAY fail (why?)
247 set +e;killall -HUP httpd;set -e
250 patch -N /root/.cshrc <root-cshrc.diff
251 patch -N /root/.login <root-login.diff
252 patch -N /root/.forward <root-mail.diff
255 set +e;killall -HUP inetd;set -e
258 for i in /usr/local/etc/*_key;do
259 echo -n "$i: ";/usr/local/bin/ssh-keygen -l -f $i
264 ) 2>&1|tee enbrace.`date '+%Y-%m-%d-%H:%M:%S'`.log