|
|
|
@ -0,0 +1,52 @@ |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# GENERIC STARTING |
|
|
|
#================================================= |
|
|
|
# IMPORT GENERIC HELPERS |
|
|
|
#================================================= |
|
|
|
|
|
|
|
source scripts/_common.sh |
|
|
|
source /usr/share/yunohost/helpers |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# RETRIEVE ARGUMENTS |
|
|
|
#================================================= |
|
|
|
|
|
|
|
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} |
|
|
|
|
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path) |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# CHECK IF ARGUMENTS ARE CORRECT |
|
|
|
#================================================= |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# CHECK IF AN ACTION HAS TO BE DONE |
|
|
|
#================================================= |
|
|
|
|
|
|
|
# Check the current status of the maintenance mode |
|
|
|
|
|
|
|
if [ "$(grep "maintenance" "$final_path/config/config.php" | awk '{print $3}' | cut -d',' -f1)" != "true" ] |
|
|
|
then |
|
|
|
ynh_die --message="Nextcloud isn't currently under maintenance." --ret_code=0 |
|
|
|
fi |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# SPECIFIC ACTION |
|
|
|
#================================================= |
|
|
|
# DISABLE THE MAINTENANCE MODE |
|
|
|
#================================================= |
|
|
|
|
|
|
|
ynh_script_progression --message="Disabling maintenance mode..." --weight=3 |
|
|
|
|
|
|
|
( |
|
|
|
cd "$final_path" && exec_as "$app" \ |
|
|
|
php$YNH_PHP_VERSION occ --no-interaction --no-ansi maintenance:mode --off |
|
|
|
) |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# END OF SCRIPT |
|
|
|
#================================================= |
|
|
|
|
|
|
|
ynh_script_progression --message="Execution completed" --last |