-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpdeploy
More file actions
49 lines (38 loc) · 750 Bytes
/
pdeploy
File metadata and controls
49 lines (38 loc) · 750 Bytes
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
#!/bin/bash
function usage()
{
echo "pdeploy package.tar.gz"
exit 1
}
if [ `whoami` != "root" ]; then
echo "You must be root to run this script."
exit 1
fi
if [ $# -ne 1 ]; then
usage
fi
PACKAGEFILE=$1
if [ ! -f "$PACKAGEFILE" ]; then
echo "No such package $PACKAGEFILE"
exit 1
fi
PACKAGE=`echo $PACKAGEFILE | cut -d. -f1`
echo "Unpacking $PACKAGE..."
P=`pwd`
ME=$$
mkdir t$ME
cp "$PACKAGEFILE" t$ME
cd t$ME
tar zxf "$PACKAGEFILE"
cd "$PACKAGE".PACKAGE
echo "Running install..."
if [ -f install.sh ]; then
bash ./install.sh
elif [ -f war-install.sh ]; then
bash ./war-install.sh
else
echo "No installation files (install.sh or war-install.sh) to execute."
fi
echo "Cleaning up..."
cd $P
rm -rf t$ME