A.L.E.C pisze:
Sarenka wrote:
{if (number(NODES)) for (i=0; i<number(NODES); i++) if (number(NODES[i].warning))
spróbuj jakoś tak:
if((ip2long(NODES[i].ip) & ip2long("255.255.255.0")) == ip2long("192.168.0.0"))
{result = SELECT inet_ntoa( nodes.ipaddr ) as ip, nodes.name FROM nodes, networks WHERE networks.address = ( nodes.ipaddr & inet_aton( networks.mask ) ) AND (networks.name = "NAZWA_SIECI")}
_______________________________________________ lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms
if((ip2long(NODES[i].ip) & ip2long("255.255.255.0")) == ip2long("192.168.0.0"))
{result = SELECT inet_ntoa( nodes.ipaddr ) as ip, nodes.name FROM nodes, networks WHERE networks.address = ( nodes.ipaddr & inet_aton( networks.mask ) ) AND (networks.name = "NAZWA_SIECI")}
Dzieki za odpowiedzi - zaraz potestuje. A tak btw. - nie znam kodu parsera, ale czy nie dalo by sie mu dorzucic opcji "networks" by wstawienie NODES i CUSTOMERS ograniczalo od razu do konkretnych sieci? Dla ludzi, ktorzy by opcji nie wlaczyli, tak na chlopski rozum, nic by sie nie zmienilo...
-- Pozdrawiam Krzysztof A. Michalski
_______________________________________________ lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms
{result = SELECT inet_ntoa( nodes.ipaddr ) as ip, nodes.name FROM nodes, networks WHERE networks.address = ( nodes.ipaddr & inet_aton( networks.mask ) ) AND (networks.name = "NAZWA_SIECI")}
Z tego skorzystalem. Calosc dla potomnych:
{if (fileexists("/etc/lms/scripts/warn.daemon")) deletefile("/etc/lms/scripts/warn.daemon"); /if;}
/usr/local/sbin/iptables -t nat -F WARNING
{result = SELECT inet_ntoa( nodes.ipaddr ) as ip, nodes.name, nodes.warning
FROM nodes,
networks WHERE networks.address = ( nodes.ipaddr & inet_aton( networks.mask ) ) AND (networks.name = "NAZWA_SIECI")}
{if (number(result)) for (i=0; i<number(result); i++) if (number(result[i].warning)) }/usr/local/sbin/iptables -t nat -A WARNING -s {result[i].ip} -p tcp -j REDIRECT --to-port 80\n{ /if; /for; /if}\n /usr/local/sbin/iptables -t nat -A WARNING -j RETURN\n
-- Pozdrawiam Krzysztof A. Michalski
_______________________________________________ lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms
uczestnicy (2)
-
Bartlomiej Niedziela
-
Sarenka