#! /bin/csh -f if ($#argv != 1) then echo 'Usage: bayes.install bayes.xxxx.tar.gz ' echo 'where "bayes.xxxx.tar.gz" is the gziped compressed tar file' echo ' that is to be installed. ' echo ' ' echo 'You must run this script in /vnmr as user "root"' echo ' ' echo 'root must have "gzip" in roots path' exit endif if (-d 'menulib' && \ -d 'maclib' && \ -d 'help' && \ -d 'bin' && \ -d 'fidlib' && \ -d 'user_templates') then else echo 'This script must be run from "/vnmr"' exit endif if (-f '/usr/ucb/whoami') then set auser = `/usr/ucb/whoami` else set auser = `/usr/bin/whoami` endif if $auser != 'root' then echo 'You must be root to run this script' exit endif set file = $1 if (! -f $file) then echo 'The file:' $file 'was not found, stopping' exit endif cp $file /tmp set file = /tmp/$file:t gzip -d $file set temp = $file:r if (! -f $temp) then echo 'You must have gzip in your path for this script to work correctly' exit endif cd /tmp if (-f '/usr/sbin/tar') then /usr/sbin/tar -xf $file:r else /bin/tar -xf $file:r endif if (! -d /tmp/bayes) then echo 'You must have tar in your path for this script to work correctly' exit endif cd /vnmr bayes.uninstall # copy the new files and make appropirate changes mkdir /vnmr/bayes chown vnmr1 bayes chgrp nmr bayes mv /tmp/bayes/Bayes.Predefined.Spec /vnmr/bayes mv /tmp/bayes/Bayes.test.data /vnmr/bayes mv /tmp/bayes/bin /vnmr/bayes if (! -d /usr/local/bin) then mkdir /usr/local/bin endif mv /tmp/bayes/curl/curl /usr/local/bin if (! -d /usr/local/lib) then mkdir /usr/local/lib endif mv /tmp/bayes/curl/lib*curl* /usr/local/lib mv /tmp/bayes/help /vnmr/bayes mv /tmp/bayes/lib /vnmr/bayes if(-f /vnmr/bayes/lib/libtestlib.so)then rm /vnmr/bayes/lib/libtestlib.so endif mv /tmp/bayes/maclib /vnmr/bayes mv /tmp/bayes/menulib /vnmr/bayes mv /tmp/bayes/user_templates /vnmr/bayes mv /tmp/bayes/templates /vnmr/bayes mv /tmp/bayes/Bayes.Ascii.Models /vnmr/bayes if (! -f /vnmr/user_templates/.login.orig) then cp /vnmr/user_templates/.login /vnmr/user_templates/.login.orig else rm /vnmr/user_templates/.login endif cd /vnmr/user_templates ln -s /vnmr/bayes/user_templates/.login .login cd /vnmr/maclib ln -s /vnmr/bayes/maclib/Bayes Bayes foreach f (maclib menulib help) cd /vnmr/$f ln -s /vnmr/bayes/$f $f.bayes end cd /vnmr/bayes/user_templates/dg foreach f (*) cd /vnmr/user_templates/dg if ($f != "default")then ln -s /vnmr/bayes/user_templates/dg/$f $f endif end cd /vnmr/user_templates/dg/default ln -s /vnmr/bayes/user_templates/dg/default/dg.Bayes dg.Bayes if (! -f dg.conf.orig) then mv dg.conf dg.conf.orig chmod oug-w dg.conf.orig else rm dg.conf endif ln -s /vnmr/bayes/user_templates/dg/default/dg.conf dg.conf if (! -f dg.conf.imaging.orig) then mv dg.conf.imaging dg.conf.imaging.orig chmod oug-w dg.conf.imaging.orig else rm dg.conf.imaging endif ln -s /vnmr/bayes/user_templates/dg/default/dg.conf.imaging dg.conf.imaging if(-d /vnmr/templates/layout/default) then cd /vnmr/templates/layout/default if (! -f proc.xml.orig) then mv proc.xml proc.xml.orig chmod oug-w proc.xml.orig endif if(-f /vnmr/templates/layout/default/proc.xml) then rm /vnmr/templates/layout/default/proc.xml endif ln -s /vnmr/bayes/templates/layout/default/proc.xml proc.xml if(-f /vnmr/templates/layout/default/Bayes.xml) then rm /vnmr/templates/layout/default/Bayes.xml endif ln -s /vnmr/bayes/templates/layout/default/Bayes.xml Bayes.xml endif if (-d /vnmr/templates/vnmrj/interface) then cd /vnmr/bayes/templates/vnmrj/interface foreach f (*) cd /vnmr/templates/vnmrj/interface ln -s /vnmr/bayes/templates/vnmrj/interface/$f $f end endif if (-f /tmp/Bayes.Remote.Queue.File) then mv /tmp/Bayes.Remote.Queue.File /vnmr/bayes/help chown vnmr1 /vnmr/bayes/help/* chgrp nmr /vnmr/bayes/help/* chmod oug-w /vnmr/bayes/help/* chmod oug+r /vnmr/bayes/help/* endif rm -fr $file:r rm -fr /tmp/$file rm -fr /tmp/bayes* echo Bayesian Analysis Installation Completed Successfully exit