Files
open-im-server/install_im_server.sh
T

43 lines
893 B
Bash
Raw Normal View History

2023-06-30 23:04:28 +08:00
#!/usr/bin/env bash
2023-07-12 12:28:18 +08:00
# Get the public internet IP address
internet_ip=$(curl ifconfig.me -s)
2023-06-30 23:04:28 +08:00
echo $internet_ip
2023-07-12 12:28:18 +08:00
# Load environment variables from .env file
2023-06-30 23:04:28 +08:00
source .env
echo $MINIO_ENDPOINT
2023-07-12 12:28:18 +08:00
# Replace local IP address with the public IP address in .env file
if [ $API_URL == "http://127.0.0.1:10002/object/" ]; then
sed -i "s/127.0.0.1/${internet_ip}/" .env
fi
2023-07-12 12:28:18 +08:00
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
sed -i "s/127.0.0.1/${internet_ip}/" .env
2023-06-30 23:04:28 +08:00
fi
2023-07-12 12:28:18 +08:00
# Change directory to scripts folder
cd scripts
chmod +x *.sh
# Execute necessary scripts
2023-06-30 23:04:28 +08:00
./init_pwd.sh
2023-07-12 12:28:18 +08:00
./env_check.sh
# Go back to the previous directory
cd ..
2023-07-02 22:13:10 +08:00
2023-07-12 12:28:18 +08:00
# Check if docker-compose command is available
2023-07-02 22:13:10 +08:00
if command -v docker-compose &> /dev/null
then
2023-07-12 12:28:18 +08:00
docker-compose up -d
2023-07-02 22:13:10 +08:00
else
2023-07-12 12:28:18 +08:00
docker compose up -d
2023-07-02 22:13:10 +08:00
fi
2023-07-12 12:28:18 +08:00
# Change directory to scripts folder again
cd scripts
2023-07-02 22:13:10 +08:00
2023-07-12 12:28:18 +08:00
# Check docker services
./docker_check_service.sh