1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lionwiki-t2t_ynh.git synced 2024-09-03 19:36:27 +02:00

Fix missing color at upgrade

This commit is contained in:
Salamandar 2024-01-17 16:21:15 +01:00
parent f57aa710a0
commit 9c0f0cf708
2 changed files with 11 additions and 2 deletions

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
# Password is required to regen the files...
ynh_app_setting_set --app="$app" --key=password --value="$password"
password_sha1=$(python -c 'import hashlib; import sys; a=str(sys.argv[1]); print(hashlib.sha512(a.encode("UTF-8")).hexdigest())' $password)
password_sha1=$(python -c 'import hashlib; import sys; a=str(sys.argv[1]); print(hashlib.sha512(a.encode("UTF-8")).hexdigest())' "$password")
# Validate, fix and set default value for color
color="$(_validate_color)"

View file

@ -24,11 +24,20 @@ if [[ -z "${password:-}" ]]; then
ynh_app_setting_set --app="$app" --key=password --value="$password"
fi
if [[ -z "${color:-}" ]]; then
color=$(grep -A1 'For YunoHost config' "$install_dir/templates/minimaxing/minimaxing.css" | grep -oP '^/\* @fg: #\K.*(?=;)')
if [[ -z "$password" ]]; then
command="yunohost app setting $app color -v 'YOUR BASE COLOR'"
ynh_die --message="Could not retrieve base color from config. Please run '$command' then retry the upgrade."
fi
ynh_app_setting_set --app="$app" --key=password --value="$password"
fi
#=================================================
# INITIALIZE AND STORE SETTINGS
#=================================================
password_sha1=$(python -c 'import hashlib; import sys; a=str(sys.argv[1]); print(hashlib.sha512(a.encode("UTF-8")).hexdigest())' $password)
password_sha1=$(python -c 'import hashlib; import sys; a=str(sys.argv[1]); print(hashlib.sha512(a.encode("UTF-8")).hexdigest())' "$password")
# Validate, fix and set default value for color
color="$(_validate_color)"