forked from bahamapascal/ICCR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patch-iccr.bash
executable file
·64 lines (52 loc) · 1.2 KB
/
patch-iccr.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
ver=1.0.0-rc3
pkg=iccr-${ver}.tgz
dir=/opt
iccrDir=$dir/iccr
iccrPropDir=$iccrDir/conf
iccrPropFile=$iccrPropDir/iccr.properties
iccrBinDir=$dir/iccr/bin
iccrLibDir=$dir/iccr/lib
what=ICCR
mac=0
darwin=`uname | grep -i darwin`
if [ $darwin = "Darwin" ]; then
mac=1
fi
archDir=`pwd`
tmpDir=/tmp/iccr-$ver
if [ ! -f $pkg ]; then
echo "Failed to find the required $what archive file ($pkg) in the local directory!"
echo "I can't continue"
exit
fi
if [ ! -d $iccrDir ]; then
echo "Existing $what install ($iccrDir) not found!"
echo "I can not continue"
exit
fi
echo "This script will patch the $what software that is in $iccrDir"
echo
echo "Make sure the $what process is halted by running $iccrDir/bin/iccr-ctl stop"
echo "Press enter..."
read junk
echo
echo "Extracting $pkg into temporary directory..."
echo
mkdir $tmpDir
cd $tmpDir
tar -xzf $archDir/$pkg
echo "Copying in place updated $what version $ver binary and script files..."
echo
echo "cp -f $tmpDir/iccr/bin/* $iccrBinDir"
cp -fr $tmpDir/iccr/bin/* $iccrBinDir
echo
echo "cp -fr $tmpDir/iccr/lib/* $iccrLibDir"
cp -fr $tmpDir/iccr/lib/* $iccrLibDir
cd -
rm -rf $tmpDir
###
# No new defaults in 0.9.0
###
echo
echo "Done"