mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
conditions in pre-upgrade to keep the app as it was public or ptivate
This commit is contained in:
parent
6fa9169a67
commit
0e6e4467cf
1 changed files with 28 additions and 18 deletions
|
@ -111,17 +111,22 @@ then
|
|||
visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo 0 || echo 1)
|
||||
if [[ $visitors_enabled -eq 1 ]]; then
|
||||
ynh_permission_update --permission "main" --add "visitors"
|
||||
fi
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
# Finalize the upgrade
|
||||
ynh_local_curl "/index.php"
|
||||
sleep 5
|
||||
ynh_local_curl "/index.php"
|
||||
upgrade_type="UPGRADE_APP"
|
||||
ynh_permission_update --permission "main" --remove "visitors"
|
||||
fi
|
||||
|
||||
if [[ $visitors_enabled -eq 0 ]]; then
|
||||
ynh_permission_update --permission "main" --remove "visitors"
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
# Finalize the upgrade
|
||||
ynh_local_curl "/index.php"
|
||||
sleep 5
|
||||
ynh_local_curl "/index.php"
|
||||
upgrade_type="UPGRADE_APP"
|
||||
fi
|
||||
fi
|
||||
#=================================================
|
||||
|
@ -160,17 +165,22 @@ then
|
|||
visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo 0 || echo 1)
|
||||
if [[ $visitors_enabled -eq 1 ]]; then
|
||||
ynh_permission_update --permission "main" --add "visitors"
|
||||
fi
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
# Finalize the upgrade
|
||||
ynh_local_curl "/index.php"
|
||||
sleep 5
|
||||
ynh_local_curl "/index.php"
|
||||
upgrade_type="UPGRADE_APP"
|
||||
ynh_permission_update --permission "main" --remove "visitors"
|
||||
fi
|
||||
|
||||
if [[ $visitors_enabled -eq 0 ]]; then
|
||||
ynh_permission_update --permission "main" --remove "visitors"
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
# Finalize the upgrade
|
||||
ynh_local_curl "/index.php"
|
||||
sleep 5
|
||||
ynh_local_curl "/index.php"
|
||||
upgrade_type="UPGRADE_APP"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue