From 9bc7181fcb87b81e93a47d656d9f0942048f22f9 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Tue, 2 Aug 2022 17:53:30 +0800 Subject: [PATCH] Update init.sh.jinja2 --- apps/roles/role_init/templates/init.sh.jinja2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/roles/role_init/templates/init.sh.jinja2 b/apps/roles/role_init/templates/init.sh.jinja2 index e3de1765..97cfc382 100644 --- a/apps/roles/role_init/templates/init.sh.jinja2 +++ b/apps/roles/role_init/templates/init.sh.jinja2 @@ -16,8 +16,8 @@ fi # init password sudo sed -i "s/POWER_PASSWORD=.*/POWER_PASSWORD=$new_password/g" /data/apps/{{app_name}}/.env # has_app_encrypt -has_app_encrypt=$(cat /data/apps/{{app_name}}/.env |grep "APP_ENCRYPT_PASSWORD=true") -if [ $has_app_encrypt = "APP_ENCRYPT_PASSWORD=true" ]; then +has_app_encrypt=$(cat /data/apps/{{app_name}}/.env |grep "APP_ENCRYPT_PASSWORD") +if [ $has_app_encrypt =~ "APP_ENCRYPT_PASSWORD" ]; then 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