Update init.sh.jinja2

This commit is contained in:
qiaofeng1227 2022-08-03 10:06:42 +08:00 committed by GitHub
parent a8527bfb6f
commit 1726ec1419
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,8 +17,8 @@ fi
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")
if [ "$has_app_encrypt" =~ "APP_ENCRYPT_PASSWORD" ]; then
echo "Encrypt password" 1>> /tmp/init_debug.txt
if [[ "$has_app_encrypt" =~ "APP_ENCRYPT_PASSWORD" ]]; then
echo "Encrypt password: $has_app_encrypt" 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