blob: 9cd6703fe5679915e858251735661ea1e6246022 (
plain)
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
|
#!/bin/bash
#------------------------------------------------------------------
# Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com>
# This file is part of GlusterFS.
#
# Gluster Management Gateway is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# GlusterFS is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------
ROOT_DIR=glustermg-backend-${VERSION}
DIR_NAME=${ROOT_DIR}/gmg-scripts
TAR_NAME=${ROOT_DIR}.tar
prepare-script-dir()
{
if [ -d ${DIR_NAME} ]; then
rm -rf ${DIR_NAME}
fi
mkdir -p ${DIR_NAME}
}
get-scripts()
{
cd ${DIR_NAME}
cp ../../src/org.gluster.storage.management.gateway.scripts/src/common/* .
cp ../../src/org.gluster.storage.management.gateway.scripts/src/backend/* .
chmod +x *
cd -
}
#---------------------------------------------
# Main Action Body
#---------------------------------------------
if [ $? -eq 1 ]; then
DIST_DIR=${1}
fi
echo "Packaging Gluster Management Gateway Back-end Scripts..."
prepare-script-dir
get-scripts
/bin/rm -rf ${TAR_NAME} ${TAR_NAME}.gz
tar cvf ${TAR_NAME} ${ROOT_DIR}
gzip ${TAR_NAME}
if [ ! -z "${DIST_DIR}" ]; then
mv ${TAR_NAME}.gz ${DIST_DIR}
fi
/bin/rm -rf ${ROOT_DIR}
echo "Done!"
|