#!/bin/ksh #h #h This is the networking libraries update routines stripped out of setup_ssh. #h There are now newer & better versions of ssh available than what setup_ssh #h installs, but the code that updates the libraries is still very useful. #h #h The main purpose of this is to get updated versions of certain core #h shared libraries installed in a safe manner so that 5.0.4, non-updated 5.0.5 #h & 5.0.6 systems can run programs that were compiled on updated 5.0.5, 5.0.6 #h or newer systems. #h #h Automatically takes the appropriate actions (including no action) depending #h on which version of OpenServer you have and depending on which if any #h updates you may have already applied. #h #h brian@aljex.com #h #h #---- UPDATE ----------------------------------------------------------- #h # This script is obsoleted by oss646. #h # Do not use this script any more. Install oss646 instead, like this: #h # #h # /setup_gnu ftp://ftp.sco.com/pub/openserver5/oss646b/VOL.* #h # #h #----------------------------------------------------------------------- echo " $0" grep "^#h" $0 |sed "s/^#h//" exit CWD=`pwd` # bail if not os [ `uname -s` = "SCO_SV" ] || { echo "Only for SCO Open Server!" ; exit 1 ; } # bail if not superuser. [ `id -un` = root ] || { echo "Must be root to do this!" ; exit 1 ; } # make sure /usr/local/bin is in PATH at least for the duration of this script. echo $PATH |grep -q "/usr/local/bin" || export PATH=$PATH:/usr/local/bin # we need setup_gnu and wget to download and install things. echo "Checking dependancies..." [ -f /setup_gnu ] || { echo echo "Installing setup_gnu & wget ..." cd / rftp -g -bh ftp.pcunix.com /pub/bkw setup_gnu chmod 755 setup_gnu /setup_gnu wget cd $CWD } # install new libsocket & libresolv if necessary. echo "Checking libsocket & libresolv..." case `uname -v` in 2) ls /usr/lib/libsocket.so.2 || { echo "Installing telnetd update..." T=/tmp/setup$$ mkdir -p $T cd $T wget -q -O - ftp://ftp.sco.com/pub/updates/OpenServer/CSSA-2001-SCO.10/erg711793a.Z |zcat |tar xvf - uncompress telnetd ls telnetd >/dev/null 2>&1 && { mv /etc/telnetd /etc/telnetd.old mv telnetd /etc/telnetd } zcat libsocket.so.2.Z >/usr/lib/libsocket.so.2 zcat libresolv.so.1.Z >/usr/lib/libresolv.so.1 chown bin:bin /etc/telnetd /usr/lib/libsocket.so.2 /usr/lib/libresolv.so.1 chmod 711 /etc/telnetd chmod 555 /usr/lib/libsocket.so.2 /usr/lib/libresolv.so.1 cd $CWD rm -rf $T } sum -l /usr/lib/libsocket.so.1 |grep -q "^23284055 " || { echo "Updating libsocket.so.1..." T=/tmp/setup$$ export L=libsocket.so.1 mkdir -p $T cd $T zcat `wget -q -O - ftp://ftp.sco.com/pub/openserver5/rs505a/VOL.002.000 |cpio -ivAdq */${L}.Z` >/usr/lib/${L}_505A cd /usr/lib file ${L}_505A |grep -q "dynamic lib" && { cp $L ${L}_504 cp -f ${L}_505A $L chown bin:bin $L chmod 555 $L } cd $CWD rm -rf $T } ;; 5.0.5|5.0.6) customquery listpatches |grep -q CSSA_2002_SCO_39 || { echo "Installing bind update..." /setup_gnu ftp://ftp.sco.com/pub/updates/OpenServer/CSSA-2002-SCO.39/VOL.* } ;; 5.0.7) echo "You are running Open Server 5.0.7 . You don't need me." echo "But enjoy your new wget and setup_gnu. :)" exit ;; *) echo "Unsupported / Unknown system." ; exit 1 ;; esac