diff --git a/scripts/_common.sh b/scripts/_common.sh index 45a94fd..9f755fa 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -38,6 +38,16 @@ _set_frequencies() { ynh_app_setting_set --app="$app" --key=frequency_human --value="$frequency_human" } +_fix_frequencies() { + case "$frequency" in + Daily) frequency="daily" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + "Each 3 days") frequency="days_3" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + "Weekly") frequency="weekly" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + "Biweekly") frequency="weeks_2" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + "Monthly") frequency="monthly" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + esac +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a9aec5a..72c4c39 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Ensuring downward compatibility..." +_fix_frequencies _set_frequencies # If encrypt doesn't exist, create it