-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplace_hawq.sh
More file actions
executable file
·33 lines (25 loc) · 832 Bytes
/
replace_hawq.sh
File metadata and controls
executable file
·33 lines (25 loc) · 832 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
#!/bin/bash
if [ "$#" != "1" ]; then
echo "ERROR: Need pass param: hawq tar URL or hawq tar path.">&2;
exit 1;
fi
# $1 is the hawq tar file
#if [ -d $1 ]; then
# sudo mkdir -p
#fi
echo "param1: $1"
FILE_PATH="hawq-my-bin-dbg"
# unzip to destination directory
sudo mkdir -p /usr/local/$FILE_PATH
sudo tar -zxvf $1 -C /usr/local/$FILE_PATH
# copy config files from original hawq
sudo mkdir -p /usr/local/config_bak
sudo cp -f /usr/local/hawq/greenplum_path.sh /usr/local/config_bak/
sudo cp -rf /usr/local/hawq/etc /usr/local/config_bak/
# ln hawq with replaced hawq binary
sudo rm -f /usr/local/hawq
sudo ln -fs /usr/local/$FILE_PATH /usr/local/hawq
# copy back the backup config files
sudo cp -rf /usr/local/config_bak/* /usr/local/hawq
# version specific link
sudo ln -fs /usr/local/$FILE_PATH /usr/local/hawq_2_1_0_0