Update init.sh.jinja2

This commit is contained in:
Darren 2022-07-14 09:17:30 +08:00 committed by GitHub
parent 024c4c7aba
commit 09c664614d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ sudo sed -i "s/POWER_PASSWORD=.*/POWER_PASSWORD=$new_password/g" /data/apps/{{ap
# has_app_encrypt
has_app_encrypt=$(cat /data/apps/{{app_name}}/.env |grep "APP_ENCRYPT=")
if [ $has_app_encrypt != "" ]; then
echo "encrypt password" 1>> /tmp/init_debug.txt
echo "Encrypt password" 1>> /tmp/init_debug.txt
app_encrypt_password=$(bash /data/apps/{{app_name}}/src/encrypt.sh $new_password)
sudo sed -i "s/APP_ENCRYPT_PASSWORD=.*/APP_ENCRYPT_PASSWORD=$app_encrypt_password/g" /data/apps/{{app_name}}/.env
fi
@ -29,7 +29,7 @@ rm -f temp
# init APP_URL
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
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
else
@ -43,7 +43,7 @@ sudo docker compose -f /data/apps/{{app_name}}/docker-compose.yml up -d
#2 init for applist of special
after_path=/data/apps/{{app_name}}/src/after_up.sh
if [ -f "$after_path" ]; then
echo "after_up execute" 1>> /tmp/init_debug.txt
echo "Executing after_up.sh" 1>> /tmp/init_debug.txt
bash /data/apps/{{app_name}}/src/after_up.sh
else
echo "There is not after_up"