websoft9/scripts/change_ip.sh

10 lines
346 B
Bash
Raw Normal View History

2022-07-19 16:08:43 +08:00
# init APP_URL
app_url_replace=$(cat /data/apps/$1/.env |grep APP_URL_REPLACE)
if [ $app_url_replace == "APP_URL_REPLACE=true" ]; then
echo "Change APP_URL"
public_ip=`wget -O - https://download.websoft9.com/ansible/get_ip.sh | bash`
2022-07-19 16:40:30 +08:00
sudo sed -i "s/APP_URL=.*/APP_URL=$public_ip/g" /data/apps/$1/.env
2022-07-19 16:08:43 +08:00
else
echo "There is not APP_URL"
fi