build.sh 911 字节
Newer Older
O
oceanbase-admin 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# /bin/bash
if [ `id -u` != 0 ] ; then
    echo "Please use root to run"
fi

obd_dir=`dirname $0`
python_bin='/usr/bin/python'
python_path=`whereis python`
for bin in ${python_path[@]}; do
    if [ -x $bin ]; then
        python_bin=$bin
        break 1
    fi
done

read -p "Enter python path [default $python_bin]:"
if [ "x$REPLY" != "x" ]; then
    python_bin=$REPLY
fi

rm -fr /usr/obd && mkdir -p /usr/obd
cp -r -d $obd_dir/* /usr/obd
cd /usr/obd/plugins && ln -sf oceanbase oceanbase-ce
cp -f /usr/obd/profile/obd.sh /etc/profile.d/obd.sh
F
frf12 已提交
25
rm -fr /usr/obd/mirror/remote && mkdir -p /usr/obd/mirror/remote
F
frf12 已提交
26
cd /usr/obd/mirror/remote && wget https://mirrors.aliyun.com/oceanbase/OceanBase.repo
O
oceanbase-admin 已提交
27 28 29
rm -fr /usr/bin/obd
echo -e "# /bin/bash\n$python_bin /usr/obd/_cmd.py \$*" > /usr/bin/obd
chmod +x /usr/bin/obd
F
frf12 已提交
30
echo -e 'Installation of obd finished successfully\nPlease source /etc/profile.d/obd.sh to enable it'