Browse Source

update: create crontab folder

dev
Dnomd343 2 years ago
parent
commit
572ecbe101
  1. 2
      include/constant.h
  2. 2
      src/applet/crontab.c

2
include/constant.h

@ -13,7 +13,7 @@
#define RESTART_DELAY 1 #define RESTART_DELAY 1
#define DIVERTER_TIMEOUT 6 #define DIVERTER_TIMEOUT 6
#define VERSION "1.3.0" #define VERSION "1.3.1"
#define CONFIG_FILE "cleardns.yml" #define CONFIG_FILE "cleardns.yml"
#define ADGUARD_USER "admin" #define ADGUARD_USER "admin"

2
src/applet/crontab.c

@ -28,6 +28,8 @@ void crontab_dump(crontab *info) { // show crontab options in debug log
process* crontab_load(crontab *info) { // load crontab options process* crontab_load(crontab *info) { // load crontab options
crontab_dump(info); crontab_dump(info);
create_folder("/var/spool/cron/");
create_folder("/var/spool/cron/crontabs/");
char *my_pid = uint32_to_string(getpid()); char *my_pid = uint32_to_string(getpid());
char *cron_cmd = string_join("\tkill -14 ", my_pid); // SIGALRM -> 14 char *cron_cmd = string_join("\tkill -14 ", my_pid); // SIGALRM -> 14
char *cron_exp = string_join(info->cron, cron_cmd); char *cron_exp = string_join(info->cron, cron_cmd);

Loading…
Cancel
Save