]> git.ipfire.org Git - ipfire-2.x.git/blob - src/misc-progs/getipstat.c
Merge remote-tracking branch 'origin/next' into thirteen
[ipfire-2.x.git] / src / misc-progs / getipstat.c
1 /* IPFire helper program - IPStat
2 *
3 * Get the list from IPTABLES -L
4 *
5 */
6
7 #include <stdio.h>
8 #include <string.h>
9 #include <unistd.h>
10 #include <stdlib.h>
11 #include <sys/types.h>
12 #include <fcntl.h>
13 #include "setuid.h"
14
15
16 int main(void)
17 {
18 if (!(initsetuid()))
19 exit(1);
20
21 safe_system("/sbin/iptables -L -v -n > /srv/web/ipfire/html/iptables.txt");
22 safe_system("/sbin/iptables -L -v -n -t nat > /srv/web/ipfire/html/iptablesnat.txt");
23 safe_system("/sbin/iptables -t mangle -L -v -n > /srv/web/ipfire/html/iptablesmangle.txt");
24 safe_system("chown nobody.nobody /srv/web/ipfire/html/iptables.txt /srv/web/ipfire/html/iptablesnat.txt /srv/web/ipfire/html/iptablesmangle.txt");
25
26 return 0;
27 }
28