mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-12 07:31:37 +02:00
Fixed redirector schedules - This fixes bug #0000685
This commit is contained in:
@@ -32,7 +32,7 @@ SUID_PROGS = setdmzholes setportfw setxtaccess \
|
||||
wirelessctrl getipstat getiptstate qosctrl launch-ether-wake \
|
||||
redctrl syslogdctrl extrahdctrl sambactrl upnpctrl tripwirectrl \
|
||||
smartctrl clamavctrl addonctrl pakfire mpfirectrl wlanapctrl \
|
||||
setaliases
|
||||
setaliases urlfilterctrl updxlratorctrl
|
||||
SUID_UPDX = updxsetperms
|
||||
|
||||
install : all
|
||||
|
||||
33
src/misc-progs/updxlratorctrl.c
Normal file
33
src/misc-progs/updxlratorctrl.c
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include "setuid.h"
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
if ( argc < 2 ){
|
||||
printf("invalid parameter(s)\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
if (!(initsetuid()))
|
||||
exit(1);
|
||||
|
||||
if (strcmp(argv[1], "cron") == 0){
|
||||
safe_system("rm /etc/fcron.*/updxlrator 2&>/dev/null");
|
||||
|
||||
if (strcmp(argv[2], "daily") == 0){
|
||||
safe_system("ln -s /var/ipfire/updatexlrator/bin/checkup /etc/fcron.daily/updxlrator");
|
||||
} else if (strcmp(argv[2], "weekly") == 0){
|
||||
safe_system("ln -s /var/ipfire/updatexlrator/bin/checkup /etc/fcron.weekly/updxlrator");
|
||||
} else if (strcmp(argv[2], "monthly") == 0){
|
||||
safe_system("ln -s /var/ipfire/updatexlrator/bin/checkup /etc/fcron.monthly/updxlrator");
|
||||
}else{
|
||||
printf("invalid parameter(s)\n");
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
33
src/misc-progs/urlfilterctrl.c
Normal file
33
src/misc-progs/urlfilterctrl.c
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include "setuid.h"
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
if ( argc < 2 ){
|
||||
printf("invalid parameter(s)\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
if (!(initsetuid()))
|
||||
exit(1);
|
||||
|
||||
if (strcmp(argv[1], "cron") == 0){
|
||||
safe_system("rm /etc/fcron.*/urlfilter 2&>/dev/null");
|
||||
|
||||
if (strcmp(argv[2], "daily") == 0){
|
||||
safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.daily/urlfilter");
|
||||
} else if (strcmp(argv[2], "weekly") == 0){
|
||||
safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.weekly/urlfilter");
|
||||
} else if (strcmp(argv[2], "monthly") == 0){
|
||||
safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.monthly/urlfilter");
|
||||
}else{
|
||||
printf("invalid parameter(s)\n");
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user