Update init.sh.jinja2

This commit is contained in:
qiaofeng1227 2022-09-02 16:47:20 +08:00 committed by GitHub
parent 64b83de68b
commit 3f8eda4a7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,8 @@ app_url_replace=$(cat /data/apps/{{app_name}}/.env |grep APP_URL_REPLACE)
if [ $app_url_replace = "APP_URL_REPLACE=true" ]; then
echo "Change APP_URL" 1>> /tmp/init_debug.txt
public_ip=`wget -O - https://download.websoft9.com/ansible/get_ip.sh | bash`
sudo sed -i "s/APP_URL=.*/APP_URL=$public_ip/g" /data/apps/{{app_name}}/.env
urlstr=`grep "APP_URL=" /data/apps/{{app_name}}/.env |cut -d":" -f1`
sudo sed -i "s/$urlstr/APP_URL=$public_ip/g" /data/apps/{{app_name}}/.env
else
echo "There is not APP_URL"
fi