X-Git-Url: http://git.jankratochvil.net/?p=enbrace.git;a=blobdiff_plain;f=enbrace.bash;h=0ddb2c95eaf8993e4ce044f2b04537f8e12e4e9d;hp=725a64886849330d3b36c191e3b6093a4ed5b58c;hb=50185365a8c62036d3472ce1a4accbd7ceacf8a0;hpb=b692ce87a488ebf774a2db862748a05376cbef05 diff --git a/enbrace.bash b/enbrace.bash index 725a648..0ddb2c9 100755 --- a/enbrace.bash +++ b/enbrace.bash @@ -2,7 +2,7 @@ # # $Id$ # -# cd;echo 'default login anonymous password short@' >~/.netrc;echo -e 'bi\nhash\ncd pub/priv/short/enbrace\nget enbrace.bash\nquit'|ftp vellum.cz;/usr/local/bin/bash enbrace.bash +# 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 function fatal { @@ -10,10 +10,10 @@ function fatal exit 1 } -if [ "$USER" != "root" ];then fatal "This script must be run as 'root'" ;fi -if [ "$PWD" != "/root" ];then fatal "This script must be run from directory '/root'" ;fi -if [ "$0" != "enbrace.bash" ];then fatal "This script must be named 'enbrace.bash'" ;fi -if [ -e "enbrace" ];then fatal "'/root/enbrace' directory already exists" ;fi +if [ "$USER" != "root" ];then fatal "This script must be run as 'root'" ;fi +if [ "$PWD" != "/root" ];then fatal "This script must be run from directory '/root'" ;fi +if [ "`basename "$0"`" != "enbrace.bash" ];then fatal "This script must be named 'enbrace.bash'" ;fi +if [ -e "enbrace" ];then fatal "'/root/enbrace' directory already exists" ;fi function ftpget { @@ -24,6 +24,7 @@ default prom bi hash + pass EOF if [ $# != 1 ];then fatal "ftpget(): (arg1=URL) required!";fi @@ -36,17 +37,38 @@ EOF echo -n "Using already downloaded file \"$1\": ";ls -l "$file" return 0 fi - echo -e "cd \"$dir\"\\nget \"$file\"\\nquit"|ftp "$host" + echo -e "cd \"$dir\"\\nget \"$file\"\\nquit"|ftp -v "$host" return 0 } +function dopatch +{ + cat >/root/enbrace/dopatch.diff + ( + echo "### $*";shift + if [ -d "$1" ];then + cd "$1";shift + fi + rev="$1" + [ "$rev" = rev ] && shift + forw="$1" + [ "$forw" = forw ] && shift + set +e + [ "$forw" != forw ] && while patch -RsNEp0 $* &1|tee -a /root/enbrace/dopatch.log + rm -f /root/enbrace/dopatch.diff +} + set -ex ( # Config - openssl="ftp://ftp.openssl.org/source/openssl-0.9.6b.tar.gz" - openssh="ftp://ftp1.se.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-3.0p1.tar.gz" + openssl="ftp://ftp.openssl.org/source/openssl-0.9.6c.tar.gz" + openssh="ftp://ftp1.se.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-3.1p1.tar.gz" # Init chmod +x enbrace.bash @@ -82,7 +104,7 @@ EOF echo "Server Adminstration Program started...." -+# Jan Kolar /Lace ++# Jan Kolar /Lace +echo "Starting OpenSSH service...." +/usr/local/sbin/sshd +echo "OpenSSH service started...." @@ -92,20 +114,51 @@ EOF echo "" echo "" EOF - cat >root-cshrc.diff <rc.local.diffrev + cat >root-cshrc.diffremoveold <root-cshrc.diffremovenew <root-cshrc.diffrev1 < /Lace ++# Jan Kolar /Lace +# Commented-out, must be placed in "~/.login"! +## /root/status/message/hint EOF - cat >root-login.diff <root-cshrc.diffrev2 + cat >root-cshrc.diff < /Lace ++# Commented-out, must be placed in "~/.login"! ++## /root/status/message/hint or /root/status/result/hint +EOF + cat >root-login.diffrev1 < /Lace ++# Jan Kolar /Lace +# Moved in from "~/.cshrc"! +/root/status/message/hint EOF + sed 's/jan.kolar@jklabs.cz/videoprogress@mbox.cz/g' root-login.diffrev2 + cat >root-login.diff < /Lace ++# Moved in from "~/.cshrc"! ++[ -x /root/status/message/hint ] && /root/status/message/hint ++[ -x /root/status/result/hint ] && /root/status/result/hint +EOF + cat >root-mail.diff <sendmail.diff < /Lace ++# Commented-out the "ftp" line ++###ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l + telnet stream tcp nowait root /usr/libexec/telnetd telnetd + shell stream tcp nowait root /usr/libexec/rshd rshd + login stream tcp nowait root /usr/libexec/rlogind rlogind +@@ -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 /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 /Lace ++*/30 * * * * root /usr/sbin/sendmail -q +EOF + cat >openssh-3.1p1-i386-unknown-freebsd2.2.5.diff <>confdefs.h <<\_ACEOF ++#define HAVE_BOGUS_SYS_QUEUE_H 1 ++_ACEOF ++ + ;; + *-next-*) + conf_lastlog_location="/usr/adm/lastlog" +--- defines.h-orig Wed Feb 27 03:40:49 2002 ++++ defines.h Thu Apr 4 01:00:56 2002 +@@ -146,7 +146,7 @@ + including rpc/rpc.h breaks Solaris 6 + */ + #ifndef INADDR_LOOPBACK +-#define INADDR_LOOPBACK ((ulong)0x7f000001) ++#define INADDR_LOOPBACK ((unsigned long)0x7f000001) + #endif + + /* Types */ +EOF + +# Sendmail + dopatch "sendmail openrelay" / &1|tee errs2 make install 2>&1|tee errs3 ) - patch /etc/rc.local &1|tee enbrace.`date '+%Y-%m-%H-%H:%M:%S'`.log + echo "$0: patch logs:" + echo "$0: -----------" + cat dopatch.log + echo "$0: success - check patch logs above!" +) 2>&1|tee enbrace.`date '+%Y-%m-%d-%H:%M:%S'`.log +