1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/paheko_ynh.git synced 2024-09-03 19:56:22 +02:00

Merge pull request #59 from YunoHost-Apps/fix

Update upgrade
This commit is contained in:
Robles Rodolphe 2021-09-26 17:05:24 +02:00 committed by GitHub
commit b0903ce3b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,12 +121,11 @@ then
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
fi fi
chmod 755 $final_path chmod 755 $final_path
# We need to have the app public before finalizing the upgrade # Create the visitors permission if needed
# So let's store its current state and allow visitors if needed visitors_enabled=$(ynh_permission_has_user "main" "visitors")
visitors_enabled=$(ynh_permission_has_user --permission=main --user=visitors) if [[ $visitors_enabled -eq 0 ]]; then
if [ $visitors_enabled -eq 0 ] ynh_permission_update --permission "main" --add "visitors"
ynh_permission_update --permission "main" --remove "visitors"
fi fi
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -136,8 +135,7 @@ then
ynh_local_curl "/index.php" ynh_local_curl "/index.php"
upgrade_type="UPGRADE_APP" upgrade_type="UPGRADE_APP"
# Remove visitors access if they were not allowed initially if [[ $visitors_enabled -eq 0 ]]; then
if [ $visitors_enabled -eq 0 ]
ynh_permission_update --permission "main" --remove "visitors" ynh_permission_update --permission "main" --remove "visitors"
fi fi
fi fi