Files
bpfire/src/misc-progs/getipstat.c
ms 55b4c7edc1 Bootscripte an den IPFire angepasst.
Ramdisk bearbeitet und Diskettenimages entfernt.
PCMCIA-Utils entfernt.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@381 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
2007-01-06 12:55:49 +00:00

29 lines
704 B
C

/* IPFire helper program - IPStat
*
* Get the list from IPTABLES -L
*
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <fcntl.h>
#include "setuid.h"
int main(void)
{
if (!(initsetuid()))
exit(1);
safe_system("/sbin/iptables -L -v -n > /srv/web/ipfire/html/iptables.txt");
safe_system("/sbin/iptables -L -v -n -t nat > /srv/web/ipfire/html/iptablesnat.txt");
safe_system("/sbin/iptables -t mangle -L -v -n > /srv/web/ipfire/html/iptablesmangle.txt");
safe_system("chown nobody.nobody /srv/web/ipfire/html/iptables.txt /srv/web/ipfire/html/iptablesnat.txt /srv/web/ipfire/html/iptablesmangle.txt");
return 0;
}