]> git.ipfire.org Git - ipfire-2.x.git/blame - src/misc-progs/getipstat.c
openvpnctrl: Support killing only the roadwarrior server.
[ipfire-2.x.git] / src / misc-progs / getipstat.c
CommitLineData
a68fedca
MT
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
16int main(void)
17{
18 if (!(initsetuid()))
19 exit(1);
20
55b4c7ed
MT
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");
a68fedca
MT
25
26 return 0;
27}
28