mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
simplify Temporarily enable visitors for curl if needed
This commit is contained in:
parent
b212b16214
commit
2be21892a9
1 changed files with 12 additions and 19 deletions
|
@ -111,13 +111,13 @@ then
|
||||||
visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo yes || echo no)
|
visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo yes || echo no)
|
||||||
if [[ $visitors_enabled == "no" ]]; then
|
if [[ $visitors_enabled == "no" ]]; then
|
||||||
ynh_permission_update --permission "main" --add "visitors"
|
ynh_permission_update --permission "main" --add "visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Finalize the upgrade
|
# Finalize the upgrade
|
||||||
ynh_local_curl "/index.php"
|
ynh_local_curl "/index.php"
|
||||||
sleep 5
|
sleep 5
|
||||||
ynh_local_curl "/index.php"
|
ynh_local_curl "/index.php"
|
||||||
|
|
||||||
if [[ $visitors_enabled == "no" ]]; then
|
if [[ $visitors_enabled == "no" ]]; then
|
||||||
ynh_permission_update --permission "main" --remove "visitors"
|
ynh_permission_update --permission "main" --remove "visitors"
|
||||||
fi
|
fi
|
||||||
|
@ -154,26 +154,19 @@ then
|
||||||
chown -R $app:$app $final_path
|
chown -R $app:$app $final_path
|
||||||
chmod 755 $final_path
|
chmod 755 $final_path
|
||||||
|
|
||||||
# Create the visitors permission if needed
|
# Temporarily enable visitors for curl if needed
|
||||||
visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo 0 || echo 1)
|
visitors_enabled=$(ynh_permission_has_user "main" "visitors" && echo yes || echo no)
|
||||||
if [[ $visitors_enabled -eq 1 ]]; then
|
if [[ $visitors_enabled == "no" ]]; then
|
||||||
ynh_permission_update --permission "main" --add "visitors"
|
ynh_permission_update --permission "main" --add "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"
|
|
||||||
ynh_permission_update --permission "main" --remove "visitors"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $visitors_enabled -eq 0 ]]; then
|
# Finalize the upgrade
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_local_curl "/index.php"
|
||||||
# Finalize the upgrade
|
sleep 5
|
||||||
ynh_local_curl "/index.php"
|
ynh_local_curl "/index.php"
|
||||||
sleep 5
|
|
||||||
ynh_local_curl "/index.php"
|
if [[ $visitors_enabled == "no" ]]; then
|
||||||
upgrade_type="UPGRADE_APP"
|
ynh_permission_update --permission "main" --remove "visitors"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue