X-Git-Url: http://git.jankratochvil.net/?p=enbrace.git;a=blobdiff_plain;f=enbrace.bash;h=0ddb2c95eaf8993e4ce044f2b04537f8e12e4e9d;hp=bd4d44d85cd4ec73e614a4e5a4a04e9afff67983;hb=50185365a8c62036d3472ce1a4accbd7ceacf8a0;hpb=187f2893dbf88a6230e7b19537c5e529da11a858 diff --git a/enbrace.bash b/enbrace.bash index bd4d44d..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 @@ -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 +# 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 <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 @@ -156,11 +241,45 @@ EOF +# 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 - (cd / - patch -sEp0 &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 +