add: weekly schedules support

This commit is contained in:
Tobias Reisinger 2020-04-25 00:48:59 +02:00
parent db3bcaf7d1
commit 2fd48ac5e6
18 changed files with 301 additions and 86 deletions

12
helpers/get_day_of_week.c Normal file
View file

@ -0,0 +1,12 @@
#include <time.h>
#include <helpers.h>
int
helper_get_weekday(const time_t timestamp_now)
{
struct tm *now = localtime(&timestamp_now);
int wday_sun_sat = now->tm_wday;
int wday_mon_sun = (wday_sun_sat + 6) % 7;
return wday_mon_sun;
}

View file

@ -18,7 +18,7 @@ static const char *const usage[] = {
#define PERM_EXEC (1<<2)
void
helpers_parse_cli(int argc, const char **argv, config_t *config)
helper_parse_cli(int argc, const char **argv, config_t *config)
{
struct argparse_option options[] =
{