#! /bin/csh -f if ($#argv != 2) then echo 'Usage: bayes.remote user bayes.xxxx.tar.gz ' echo 'where "user" is the account you want the remote processing' echo ' software installed, ' echo 'and "bayes.xxxx.tar.gz" is the gziped compressed tar file' echo ' that is to be installed, where "xxxx" is name of the hardware.' echo ' ' echo 'You must run this script in the remote account as "root" and ' echo 'root must have both "gzip" and "tar" in its path.' echo 'Before running this script you must create the "user" account.' exit endif set user = $1 set file = $2 cd ~$user set auser = `whoami` if $auser != 'root' then echo 'You must be root to run this script' exit endif 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 tar -xf $file:r if (! -d /tmp/bayes) then echo 'You must have tar in your path for this script to work correctly' exit endif cd ~$user if (! -d ~$user/bin) then rm -r ~$user/bin endif if (! -d ~$user/sbin) then rm -r ~$user/sbin endif if (! -d ~$user/cgi-bin) then rm -r ~$user/cgi-bin endif if (! -d ~$user/lib) then rm -r ~$user/lib endif mv /tmp/bayes/bin ~$user mv /tmp/bayes/sbin ~$user mv /tmp/bayes/cgi-bin ~$user mv /tmp/bayes/lib ~$user rm -fr $file:r rm -fr /tmp/bayes* rm -fr /tmp/$file echo Bayesian Analysis Remote Installation Completed Successfully echo If the cgi-bin directory is not located in this account you echo must move the contents of that directory to the appropirate echo cgi-bin directory exit