1 |
williamc |
1.1 |
#!/usr/local/bin/perl5
|
2 |
|
|
#
|
3 |
|
|
# SCRAM Installation Script
|
4 |
|
|
#
|
5 |
|
|
# To be run from the Installation directory
|
6 |
|
|
#
|
7 |
|
|
|
8 |
|
|
use Cwd;
|
9 |
|
|
$thisdir=cwd();
|
10 |
|
|
(($basedir=$thisdir)=~s/(.*)\/.*/\1/);
|
11 |
|
|
($topdir=$basedir)=~s/(.*)\/.*/\1/;
|
12 |
|
|
|
13 |
williamc |
1.3 |
# Create the directory for storing databases
|
14 |
|
|
use File::Path;
|
15 |
|
|
mkpath("$topdir/scramdb", 0, 0755);
|
16 |
|
|
|
17 |
williamc |
1.1 |
# Copy the wrapper file with the correct base variable installed
|
18 |
|
|
open ( WRAP , "<scramwrapper") or die "Unable to open scramwrapper $!";
|
19 |
|
|
open ( OUTFILE , ">$topdir/scram") or die "Unable to open $topdir/scram $!";
|
20 |
|
|
while ( <WRAP> ) {
|
21 |
|
|
$_=~s/__basedir__/$basedir/g;
|
22 |
|
|
print OUTFILE $_;
|
23 |
|
|
}
|
24 |
williamc |
1.2 |
chmod 0755, "$topdir/scram";
|
25 |
williamc |
1.1 |
close WRAP;
|