#!/bin/ksh # fetches all the stuff to install ssh on osr5 # v 1.5 - network libraries update portion broken out into seperate script. # test for 5.0.7 which already has newer ssh and all libs. # v 1.6 - replaced setup_netlibs with oss646. # updated sco.com urls # v 1.7 - fix missing quote in version check case statement # updated oss646b to oss646c # disabled the entire script. SCO have official packages now that # do everything this script does, only better. # # brian@aljex.com cat <<-%%MSG This script is now obsolete and will quit without taking any action. SCO have produced nice custom-installable VOL packages now that do everything this script did, only better. The exact packages you need depend on the version of Open Server you have. For 5.0.7 or later, you don't need anything. It's already there. For earlier versions the general rule would be to install this package: ftp://ftp.sco.com/pub/openserver5/507/other/openssh40p1/openssh40p1_vol.tar But first read it's readme (openssh40p1.txt, found in the same directory as above) and install any prerequisites it mentions, and back-track, reading their readme's for prerequisites, and so on. As an example, if you had a freshly installed 5.0.6 with no patches yet, then you'd install these, in this order: ftp://ftp.sco.com/pub/openserver5/rs506a/rs506a.tar ftp://ftp.sco.com/pub/openserver5/oss646c/VOL.* ftp://ftp.sco.com/pub/openserver5/507/other/gwxlibs200Eb/gwxlibs200Eb_vol.tar ftp://ftp.sco.com/pub/openserver5/507/other/openssh40p1/openssh40p1_vol.tar %%MSG exit CWD=`pwd` PRNGD="0.9.23" ZLIB="1.1.4" GLIB="1.5" OSS646="oss646c" # bail if not superuser. [ `id -un` = root ] || { echo "Must be root to do this!" ; exit 1 ; } # 5.0.7 & up ship with better versions of everything here already built-in. case `uname -v` in 2|5.0.5|5.0.6) : ;; 5.0.7) echo "You are running Open Server 5.0.7 . You don't need me. :)" ; exit ;; *) echo "Unsupported / Unknown system. Cannot install." ; exit 1 ;; esac # 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 } # not strictly necessary, but wise to get Glib installed before zlib. echo "Checking dependancies..." customquery listpatches |grep -q Glib || { echo echo "It appears that you do not have Glib installed. This version of OpenSSH" echo "requires a specific version of zlib, which will be installed automatically" echo "if necessary. But Glib also contains a version of zlib that would displace" echo "the special version needed by OpenSSH if you installed Glib at some later" echo "date. Glib contains libraries needed by several popular graphics-related" echo "programs and as such it's fairly likely you will want to install Glib" echo "sooner or later." echo echo "If you install Glib now, (before installing zlib), then you are less likely" echo "to accidentally break OpenSSH at some point in the future. This is especially" echo "important to be aware of if you plan to disable telnet and rlogin" echo echo "install Glib now? (Y/n): \c" ; read YN case $YN in [Yy]*|"") /setup_gnu Glib-$GLIB ;; esac } # prngd must come before ssh, and it must be a specific version. echo "Checking dependancies..." [ "X`customquery listpatches |grep PRNGD |cut -d: -f4`" = "X$PRNGD" ] || { echo "Installing prngd..." /setup_gnu prngd-$PRNGD } # zlib must come before ssh, and it must be a specific version. echo "Checking dependancies..." [ "X`customquery listpatches |grep zlib |cut -d: -f4`" = "X$ZLIB" ] || { echo "Installing zlib..." /setup_gnu zlib-$ZLIB } # install new libsocket & libresolv if necessary. echo "Checking dependancies..." case `uname -v` in 2|5.0.5|5.0.6) customquery listpatches |grep -q OSS646 || { echo "Installing ${OSS646} \"Execution Environment Update\"..." /setup_gnu ftp://ftp.sco.com/pub/openserver5/${OSS646}/VOL.* } ;; esac # prngd init script has several problems. replace it. echo "replacing stock prngd start script..." cd /etc/init.d mv -f prngd prngd.orig wget -O prngd http://www.aljex.com/bkw/sco/rc.prngd chmod 755 prngd # start prngd before installing ssh. echo "adding prngd to system startup..." ./prngd enable # this sets it up to start on boot echo "starting prngd..." ./prngd start # this starts it up now cd $CWD # now install ssh. echo "Installing OpenSSH..." /setup_gnu ftp://ftp.sco.com/pub/OpenServer/CSSA-2002-SCO.10/openssh-3.1p1-VOLS.tar # need to modify the ssh init script slightly if on 5.0.4. case `uname -v` in 2) # 5.0.4 does not have /sbin cd /etc/init.d mv sshrc sshrc.old sed "s;/sbin/sh;/bin/sh;" sshrc.old >sshrc chmod 755 sshrc ;; esac # install init script to start sshd at boot. echo "adding sshd to system startup..." /etc/init.d/sshrc enable # and start sshd up now too so it's running between now and next bootup. echo "starting sshd..." /etc/init.d/sshrc start ssh -V echo "ssh and sftp client and server is now installed and running."