1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/archivist_ynh.git synced 2024-09-03 18:15:55 +02:00
archivist_ynh/scripts/_common.sh
2024-03-29 12:47:49 +01:00

47 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
#=================================================
# PERSONAL HELPERS
#=================================================
_set_frequencies() {
case "$frequency" in
daily)
frequency_cron="0 2 * * *"
frequency_human="every day"
;;
days_3)
frequency_cron="0 2 */3 * *"
frequency_human="each 3 days"
;;
weekly)
frequency_cron="0 2 * * 0"
frequency_human="once a week on sunday"
;;
weeks_2)
frequency_cron="0 2 * * 0/2"
frequency_human="one sunday out of two"
;;
monthly)
frequency_cron="0 2 1 * *"
frequency_human="once a month on the first sunday"
;;
*)
ynh_die --message="Unsupported frequency $frequency" ;;
esac
# For POST_INSTALL.md
ynh_app_setting_set --app="$app" --key=frequency_human --value="$frequency_human"
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================