#!/bin/ksh export PWD V=61u3 prog=sablime_install VER=v6.1u3 usage="usage: $prog [-revert] directory" (PATH=.; alias -x) >/dev/null 2>&1 || { echo 1>&2 "" echo 1>&2 "$0: requires Korn Shell. Try running 'ksh $0'." echo 1>&2 "" exit 1 } ###################### Function definitions ####################### function die { print -u2 "$@" exit 1 } function msg { print -u2 "$1" } function err { print -u2 "$1" } function chkpath { for cmd do junk=`whence $cmd` || die "Error: $cmd not in PATH" done } function set_arch { uREL=`uname -r` uMACH=`uname -m` arch=unknown case $uMACH in i586|i686) case `uname -s` in Linux) arch=ilinux ;; Interix) arch=interix ;; UnixWare) arch=unixware ;; esac ;; sun4[umc]) case $uREL in 4.1.[1234]*) arch=sparc4 ;; 5.[456789]*|5.10) arch=sparc5 ;; 5.[123]*) arch=ancient_sparc5 ;; esac ;; 9000/7*|9000/8*) case $uREL in A.09.*) arch=hppa9 ;; B.10.*) arch=hppa10 ;; B.11.*) arch=hppa11 ;; esac ;; 000116833500|000910924C00) case `uname -v` in 5) arch=rs6k_5 ;; *) arch=rs6k ;; esac;; esac } function chktarfile { test -f $1 || die "Installation file $1 not found" test -r $1 || die "Installation file $1 not readable" case `gunzip <$1 | tar tf - ./edput | grep '^\./edput$'` in ./edput) ;; *) die "Error: unable to unpack $1" ;; esac } function ValidPerlVersion { typeset PERL PERL=$1 test -f "$PERL" || { echo "$PERL: not found"; exit 1 ;} case `$PERL -e 'print $] >= 5.00401 ? "good\n" : "bad\n"'` in good) return 0 ;; bad) V=`$PERL -e '$_=$]; s/^\D+//; $_ = (split)[0]; print'` err "$PERL is version $V, need 5.004_01 or later" ;; *) err "$PERL: not perl, or unknown version" ;; esac return 1 } function checkdir { test -d $1 || { err "Directory $1 not found"; return 1 ;} test -O $1 || { err "$1 is not owned by you"; return 1 ;} test -r $1 || { err "$1 is not readable by you"; return 1 ;} test -w $1 || { err "$1 is not writable by you"; return 1 ;} test -x $1 || { err "$1 is not executable by you"; return 1 ;} } function checkfile { test -f $1 || { err "File $1 not found"; return 1 ;} test -O $1 || { err "You are not the owner of $1"; return 1 ;} test -r $1 || { err "$1 is not readable by you"; return 1 ;} } function ask { print -u2 "$1" prompt="${2:-\\nProceed? [ynq]}" print -u2 -n "$prompt " read ANS case $ANS in [yY]|[Yy]es|YES) return 0;; [nN]|[Nn]o|NO) return 1;; [qQ]|[Qq]uit|QUIT) exit 0 ;; esac print -u2 "Please type y or n, or q to quit". print -u2 -n "$prompt " read ANS case $ANS in [yY]|[Yy]es|YES) return 0;; [nN]|[Nn]o|NO) return 1;; [qQ]|[Qq]uit|QUIT) exit 0 ;; *) exit 1 ;; esac } function getsabvar { eval A=\${$1:-} test -n "$A" && return 0; test -f "$sabVAR" || return 1; eval $1=`. $sabVAR; eval 'echo' "\$"$1` eval A=\${$1:-} test -n "$A" } function getsabenv { getsabvar sabLCB || return 1 getsabvar sabGDB || return 1 getsabvar sabGEN || return 1 getsabvar sabPROD || return 1 case $sabLCB in /*) ;; *) err "sabLCB must be a full pathname"; return 1 ;; esac checkdir $sabLCB || return 1 checkdir $sabGDB || return 1 checkdir $sabGDB/PR || return 1 checkdir $sabGDB/PTS || return 1 msg "Sablime bin: $sabLCB" } function no_sab_stuff { for i in $OLDFILES do test -a "$DIR/$i" && { err "$DIR contains a Sablime file: $i"; return 1 ;} done return 0 } function confirm_dir { checkdir $DIR || return 1 err "" case $sabLCB in $DIR) checkmcb case $? in 0) ask "Ready to upgrade your current installation at $DIR." || return 1 replacebin=true ;; *) err "You must set your Sablime environment before running $prog." err "Run . sablime to set to an existing generic." return 1 ;; esac ;; "") if no_sab_stuff then ask "Ready to install a new copy of Sablime at $DIR. If you have an existing version, it will not be changed." || return 1 else err "You must set your Sablime environment before running $prog." err "Run . sablime to set to an existing generic." return 1 fi ;; *) ask "Ready to install a new copy of Sablime at $DIR, The copy at $sabLCB will not be changed." || return 1 ;; esac init_config } function checkmcb { getsabenv || return 1 checkdir $sabLCB || return 1 checkfile $sabLCB/.usrid || return 1 checkfile $sabLCB/sabinfo || return 1 checkver $sabLCB/sabinfo || return 1 } function SabVersion { LC_CTYPE=C $perl -e ' $/ = "\@(#)"; open FILE, $ARGV[0]; binmode FILE; while () { next unless /^Sablime ([\w.]+)/; print $1; last; }' $1 } function checkver { myver=`SabVersion $1` case $myver in $VER) msg "Sablime $VER is already installed."; exit 0 ;; esac msg "Current version: $myver" } function check_complete { test -f $DATA/status || return case `tail -1 $DATA/status` in complete) msg "Sablime $VER already installed."; exit 0 ;; esac } function getwebvar_ns { sed -n -e '/.*'$2'="\(.*\)".*/s//\1/p' $1 | head -1 } function getwebvar_ws { sed -n -e '/.*'$2' = "\(.*\)".*/s//\1/p' $1 } function init_config { VARZ=$(set_vars) test -d $DATA || mkdir $DATA echo "$VARZ" >$DATA/config } function set_vars { print "TARFILE=\"$PWD/$TARFILE\"" print "replacebin=\"$replacebin\"" typeset RES WSAB NCONF CHK OLD HOM OLD=$sabLCB WSAB=$OLD/web/wsab test -f $WSAB/prodGen || return test -f $WSAB/wsab.conf || return test -h $OLD/sabpasswd || return test -h $WSAB/sabexec || return msg "Reading previous web Sablime settings ..." RES=$OLD/web/admin/reset_perl NCONF=$WSAB/wsab.nonconf CHK=$WSAB/wsabcheck HOM=` sed -n -e '/^[ \t]*SABHOME=/s///p' $RES` case $HOM in \"*\") HOM=${HOM#?}; HOM=${HOM%?} ;; esac case $HOM in $sabLCB) ;; *) die "SABHOME value [$HOM] from previous installation does not match current setting of \$sabLCB" ;; esac #PERL1="` getwebvar_ws $CHK PERL`" if test -f $WSAB/run then PERL1="` sed -n 1s/..//p $WSAB/run`" else PERL1="` sed -n 1s/..//p $WSAB/wedput.pl`" fi perl=${PERL1%% *} KSH="` getwebvar_ws $NCONF KSH`" PERL="` getwebvar_ws $CHK PERL`" ServerRoot="` getwebvar_ns $CHK ServerRoot`" ServerHost="` getwebvar_ns $CHK ServerHost`" WebSabOwner="` getwebvar_ns $CHK WebSabOwner`" httpdConfFile="`getwebvar_ns $CHK httpdConfFile`" HTPASSWD="` strings -a $OLD/sabpasswd | grep /htpasswd | head -1`" SABPASSWD=` $perl -e 'my $L = readlink "'$OLD'/sabpasswd"; print $L,"\n";'` ROOTDIR=`$perl -e 'my $W = "'$OLD'/web/wsab"; (my $L = readlink "$W/sabexec") =~ s:/sabexec$::; $L = "$W/$L" unless $L =~ m{^/}; print $L,"\n";'` PFilePath=`grep AuthUserFile $ROOTDIR/sablime.conf | sed 's/.* //'` PFile=${PFilePath##*/} case $PFilePath in $OLD/web/root_install/$PFile) webmode=REPLACE ;; *) webmode=KEEP ;; esac cat <<-EoF webmode="$webmode" PERL1="$PERL1" PERL="$PERL" KSH="$KSH" ServerRoot="$ServerRoot" ServerHost="$ServerHost" WebSabOwner="$WebSabOwner" httpdConfFile="$httpdConfFile" HTPASSWD="$HTPASSWD" SABPASSWD="$SABPASSWD" ROOTDIR="$ROOTDIR" PFilePath="$PFilePath" PFile="$PFile" EoF $perl -e 'use lib "$ARGV[0]"; require "wsab.conf"; print <$DIR/web/wsab/wsab.conf } function mv_trash { TRASH=$DATA/.trash$$ test -d $TRASH || mkdir $TRASH for i do test -a "$i" && mv "$i" $TRASH done } function do_link { rm -f $2; ln -s $1 $2 } function web_convert { typeset OLD OROOT NROOT ADM OLD=$DATA/oldbin OROOT=$OLD/web/root_install NROOT=$DIR/web/root_install ADM=$DIR/web/admin WSAB=$DIR/web/wsab KSH=${KSH%% *} $perl -p -e " s|PERL=.*|PERL='$PERL'|; s|KSH=.*|KSH='$KSH'| if '$KSH' ne '/bin/ksh'; s|SERVER_ROOT=.*|SERVER_ROOT=$ServerRoot|; s|WEB_CONF_FILE=.*|WEB_CONF_FILE=$httpdConfFile| if '$httpdConfFile' ne '$ServerRoot/conf/httpd.conf'; s|HTPASSWD=.*|HTPASSWD=$HTPASSWD|; " $ADM/config.input.tmpl >$ADM/config.input fix_wsab_conf cp $OLD/web/wsab/prodGen $DIR/web/wsab #cat $DATA/config case $1 in REPLACE) cp $OROOT/$PFile $ADM/.htpasswd test -d $NROOT || mkdir $NROOT cd $NROOT do_link ../admin/.htpasswd $PFile ksh $ADM/wsab_install -skip_server ;; KEEP) case $ROOTDIR in $sabLCB/web/root_install) restore_rootdir $DATA/oldbin $DIR esac do_link $ROOTDIR/sabexec $WSAB/sabX cd $ADM do_link $PFilePath .htpasswd ksh $ADM/wsab_install -skip_server do_link $SABPASSWD $DIR/sabpasswd ;; esac test -d $OLD/web/reports || return 0 cd $OLD/web && tar cf - reports | (cd $DIR/web; tar xof -) } function unpack_tarfile { msg "Unpacking tarfile $TARFILE" test -d $DATA/ntmp || mkdir $DATA/ntmp (cd $DATA/ntmp; gunzip <$TARFILE | tar xof - ) mv $DATA/ntmp $DATA/newbin } function mk_backup { msg "Backing up files..." $perl -e ' use File::Path; my $DATA = shift; my $BKUP = "$DATA/oldbin"; exit 0 if -d $BKUP; (my $lcb = $DATA) =~ s|/[^/]*$||; chdir $lcb or die "error: cannot chdir $lcb\n"; my $tmpbin = "$DATA/tmpbin"; eval { mkpath($tmpbin,0) }; die "mkpath: $@\n" if $@; #for (@ARGV) { print "check $_\n"; } for (@ARGV) { -e $_ && rename $_, "$tmpbin/$_"; } rename $tmpbin, $BKUP; ' $DATA $OLDFILES } function install_newbin { test -d $DATA/oldbin && $perl -e ' # copy project-added VHELP files to the VHELP dir in the new tree use File::Copy; my ($srcdir, $targdir) = @ARGV; my %newvh; my %myvh = map { $_ => 1 } qw( 1030 1031 1032 1033 1035 1036 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1151 1152 1153 1154 1155 1156 1157 1158 1161 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1301 1302 1303 1304 1305 1306 1308 1309 1310 1311 1312 1313 1314 1315 1320 1321 1322 1323 1325 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1368 1371 1382 1383 1384 1385 1386 1387 1388 1389 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1501 1502 1503 1504 1505 1506 1507 1509 1510 1511 1512 1513 1514 1515 1633 1634 1635 1636 1637 1639 1640 1641 1642 1643 1644 1651 1652 1653 1655 1656 1657 1660 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1690 1691 1692 1693 1694 1695 1700 1701 1702 1703 1704 1705 1707 1708 1709 1711 1712 1713 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1770 1771 1772 1773 1774 1775 1776 1777 1780 1781 1782 1789 1791 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1834 1835 1836 1837 1851 1852 1853 1854 1855 1857 1858 1859 1860 1861 1862 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2131 2132 2161 2162 2191 2192 2193 2194 2195 2196 2211 2291 2292 2293 2294 2295 2321 2322 2323 2324 2325 2361 2362 2363 2364 2365 2366 2367 2368 2369 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2401 2402 2421 2422 2441 2442 2461 2462 2481 2482 2483 2501 2502 2503 2521 2522 2523 2524 2551 2552 2553 2554 2555 2556 2601 2602 2603 2621 2622 2623 2624 2625 2630 2631 2632 2633 2634 2641 2642 2661 2662 2681 2682 2701 2702 2703 2721 2722 2741 2742 2743 2761 2762 2763 2781 2782 2783 2784 2785 2801 2802 2803 2831 2832 2833 2834 2835 2871 2872 2873 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2901 2902 2903 2921 2922 2923 2924 2925 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3141 3142 3143 3144 3145 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3181 3182 3183 3184 3185 3186 3187 3188 3189 3191 3192 3193 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3221 3222 3223 3241 3242 3243 3244 3261 3262 3263 3281 3282 3283 3284 3285 3286 3287 3288 3301 3302 3303 3307 3308 3309 3310 3311 3312 3348 3501 3502 3503 3504 3505 3521 3522 3523 3524 3525 3526 3541 3542 3543 3544 3545 3546 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3575 3576 3598 3601 3602 3603 3604 3605 3612 3620 3625 3628 3640 3641 3642 3643 3644 3645 3646 3647 4001 4002 4003 4004 4005 4006 4007 4008 4009 4021 4022 4023 4024 4025 4026 4031 4032 4033 4034 4035 4036 4037 4038 4041 4042 4043 4044 4045 4051 4052 4053 4054 4055 4056 4057 4058 4059 4061 4062 4063 4064 4071 4072 4073 4074 4075 4076 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4210 4211 4212 4213 4214 4215 4216 4218 4219 4220 4221 4222 4223 4224 4225 4226 4240 4241 4242 4254 4255 4256 4257 4258 4260 4261 4262 4263 4500 4501 4502 4503 4504 4505 4506 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5018 5019 5020 5021 5022 5023 5024 5025 5026 5029 5030 5031 5032 5033 5035 5036 5037 5038 5039 5040 5041 5042 5043 5045 5046 5047 5050 5051 5052 5054 5055 5056 5057 5058 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5075 5076 5077 5078 5079 5080 5081 5085 5086 5088 5089 5094 5095 5096 5098 5099 5100 5101 5102 5103 5104 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5120 5123 5124 5125 5126 5128 5130 5131 5132 5133 5134 5135 5138 5139 5140 5141 5144 5145 5146 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5170 5171 5172 5173 5174 5176 5177 5178 5179 5180 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5201 5202 5203 5204 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5225 5226 5227 5228 5229 5230 5231 5233 5234 5235 5237 5238 5239 5240 5241 5242 5244 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5266 5267 5268 5270 5271 5272 5274 5276 5277 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5301 5303 5304 5305 5306 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6030 6031 6032 6033 6034 6035 6036 6037 6038 6050 6051 6060 6061 6062 6063 6070 6071 6072 6080 999); opendir DIR, $targdir or die "targ: $targdir: $!"; while ( defined ( $_ = readdir DIR ) ) { next if $_ eq "." || $_ eq ".."; $newvh{$_} = 1; } closedir DIR; opendir DIR, $srcdir or die "src: $srcdir: $!"; while ( defined ( $_ = readdir DIR ) ) { next if $_ eq "." || $_ eq ".." || $newvh{$_}; if (-l "$srcdir/$_") { my $L = readlink "$srcdir/$_"; symlink $L, "$targdir/$_"; next; } next if $myvh{$_}; copy "$srcdir/$_", "$targdir/$_"; } closedir DIR; ' $DATA/oldbin $DATA/newbin msg "Installing files..." $perl -e ' use File::Path; my ($srcdir, $targdir) = @ARGV; chdir $srcdir or die "error: cannot chdir $srcdir\n"; opendir DIR, $srcdir or die "$srcdir: $!"; while ( defined ( $_ = readdir DIR ) ) { next if $_ eq "." || $_ eq ".."; rename "$srcdir/$_", "$targdir/$_"; } ' $DATA/newbin $DIR } function do_revert { test -d $DATA/oldbin || test -d $DATA/old2 || die "Nothing to roll back" ask "This will restore the previous installation at $DIR." || return 1 if test -d $DATA/oldbin then # test ! -d $DIR/web/root_install || test -O $DIR/web/root_install || restore_rootdir $DIR $DATA/oldbin cd $DIR mv_trash CSSC SABDM SBCS TPLAT VHELP lib web web.save .BuildInfo cd $DATA/oldbin for i in * do test -f $DIR/$i && rm -f $DIR/$i done cd $DIR mv $DATA/oldbin $DATA/old2 fi test -f $DATA/old2/.BuildInfo && mv $DATA/old2/.BuildInfo $DIR mv $DATA/old2/* $DIR rm -rf $DATA/* test -f $DIR/sablime.sh-new && rm -f $DIR/sablime.sh-new test -f $DIR/xsablime.sh-new && rm -f $DIR/xsablime.sh-new exit 0 } OLDFILES=$(cat <<-EoF .BuildInfo 3.0.2old_data 3.1ftd_data 3.1old_data 4.0ftd_data 4.0old_data 4.2ftd_data 4.3old_data 5.0ftd_data 5.0old_data 5.1ftd_data 5.1old_data 5.2ftd_data 5.2old_data 6.0ftd_data 6.0old_data 6.1ftd_data AdiCheckFile C CSSC EdpCheckFile EmrServer FileExtMap Getversion_Output GrpServer MailDemon MailServer MailSpool MrServer MvFServer README.download SABDM SABHELP SBCS SabMerge SrcServer TPLAT VHELP WhatOutput WhatOutput.u1 WhatOutput.u2 WhatOutput.u3 absfind accept activate adddirs addgen addgsrc addisrc addsrc admin_license approve arch as.user assign attmgmt audit_crontable batch_addsrc closegen closemr colors.sjo commit common create dbconvert dbcross dbcross.old dbdelta dbdelta.old dbedit dbhash dbstart dbstop dbxcross dbxcross.old defer delay depend doc edget edput errfind fcreate fitpass fstpass ftd ftd_data getversion grp_data hcode hdiff hitpass hoh.hlp hotline.ck hstpass hyperhelp initftd initsab inspect itpass k.rtf killmr lib listmsgs mhist mk_approve mmail mrdiff mredit mrgedit mrnote mtrace mvgen ncsl ncsldiff net_recv newgen nochange node_update node_validate nohist nomail notrace novhelp novinfo novprom o.usrid patchlevel pcsabd pdi preapprove prefitpass prefs.sjo prefstpass prehitpass prehstpass preinspect preitpass prepublish prestpass primsdb printrec propose pts ptsaudit ptscleanup ptsconv ptsrollback publish qmr query rcv_msgs recfind reject report repwiz.pl reserve reset_ksh review rmdirs rptgraph run_audits sab2sccs sab4.0clean sab4.0conv sab4.0rollbk sab4.2update sab4.3update sab5.0clean sab5.0conv sab5.0rollbk sab5.1clean sab5.1conv sab5.1rollbk sab5.2clean sab5.2conv sab5.2rollbk sab6.0clean sab6.0conv sab6.0rollbk sab95inst.exe sabhelp sabhostid sabinfo sabinst.exe sablime sablime.sh sablimed sabmldm sabpasswd sabrepdm sabxwin.hlp screate sendmsgs setgroup setnode setperm setrel sget sh2x shabs shcat shell_check sherr shrec smerge snapedit source spacecheck spawnmr srcpr sreport ssql stpass study submit suucpdm template tempset test_sablicense testassign testpass testpass.old unaccept uncommon unedget unedput unreserve vhelp vinfo vprom web web_update_to_v61 whatoutput wssqlsh xbin xprinter xsab xsablime xsablime.sh EoF) ######################### Main Execution ########################## replacebin=false revert=false set_arch case $1 in -help|--help|-\?) echo 1>&2 "$usage"; exit 0 ;; -revert) revert=true; shift ;; esac chkpath gunzip perl sed strings tail tar uname # $PERL is the perl is specified in wsabcheck perl=`whence perl` ValidPerlVersion $perl || exit 1 msg "This is the installation utilty for Sablime $VER." getsabvar sabLCB DIR=${1:-$sabLCB} case $DIR in ""|/*) ;; .) DIR="$PWD" ;; *) DIR="$PWD/$DIR" ;; esac test -d "$DIR" || die $usage DATA="$DIR/install_v$V" TARFILE=sab${V}_${arch}.tar.gz if $revert; then do_revert; fi check_complete test -d "$DATA/newbin" || chktarfile $TARFILE || exit 1 if test -f $DATA/config then ask " It appears that this installation was previously attempted in $DIR but it did not finish sucessfully. We will continue where we left off." "" || exit 1 else confirm_dir || exit 1 fi webmode=none . $DATA/config test -d $DATA/newbin || unpack_tarfile if "$replacebin" then test -d $DATA/oldbin || mk_backup fi install_newbin for i in sablime sablime.sh xsablime xsablime.sh do test -f $DATA/oldbin/$i || continue case $i in *.sh) test -f $DIR/$i-new || mv $DIR/$i $DIR/$i-new esac test -f $DIR/$i && rm -f $DIR/$i cp $DATA/oldbin/$i $DIR/$i done if "$replacebin" then $DIR/dbconvert case $webmode in REPLACE|KEEP) web_convert $webmode ;; *) if test -L $DATA/oldbin/web then X=`ls -l $DATA/oldbin/web | sed -e 's/.* -> //'` mv $DIR/web $DIR/web.save ln -s $X $DIR/web fi esac fi $DIR/setperm $DIR echo complete >> $DATA/status msg "" msg "Installation complete. Happy Sabliming!" msg "" case $webmode in none) msg "To install the web interface, go to $DIR/web/admin, create the config.input file, and run ksh ./wsab_install" ;; KEEP) msg "To enable support for web-only users, and get rid of the remnants of the setuid-root portions of the web interface, go to $DIR/web/admin, and run ksh ./wsab_install. When you do this, have access to someone with permission to update the web server config files and to restart the web server. Meanwhile, all other web features are fully functional." ;; esac msg "" msg "Whenever you need to update your web configuration (e.g. move your Sablime directories, or use a different web server), go to $DIR/web/admin, edit config.input, and run ksh ./wsab_install. Whenever you do this, have access to someone with permission to update the web server config files and to restart the web server." msg "" msg "For more information, see the Web Sablime Installation and Upgrade Guide." msg "" exit 0