#!/bin/bash

cd "${install_path}"/soft
if [ ! -e "/usr/local/bin/docker-compose" ]; then
    echo "docker-compose not exist!!!"
    \cp docker-compose-linux-x86_64.docker-compose-linux-x86_64 /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose
    docker-compose -v
else
    echo "docker-compose have been existed!!!"
fi

cd "${install_path}"/Install_Packages
tar -xf harbor.tar.xz -C /usr/local/
# mv harbor /usr/local/
cd /usr/local/harbor/
sed -i "s/registry.edoc2.com/$REGISTRY/g" /usr/local/harbor/harbor.yml

source install.sh --with-chartmuseum
cat /etc/hosts
cat /usr/local/harbor/harbor.yml
sleep 2
docker-compose down
sleep 2
docker-compose up -d
