diff --git a/proxy/proxy_gest.php b/proxy/proxy_gest.php index a0d9a06..4409bee 100755 --- a/proxy/proxy_gest.php +++ b/proxy/proxy_gest.php @@ -104,6 +104,33 @@ function genera ($DB_ID) { } fclose($fp); exec ("sudo /opt/squid/sbin/squid -k reconfigure"); + remote ($DB_ID); } + +function remote ($DB_ID) { + $query = " SELECT + host, + port, + usr, + pwd, + path, + command + FROM + proxy_remote + WHERE + attivo = 1 + "; + + $res = mysql_query( $query, $DB_ID ); + while ($dato = mysql_fetch_array ( $res )) { + $connection = ssh2_connect($dato['host'], $dato['port']); + ssh2_auth_password($connection, $dato['usr'], $dato['pwd']); + + ssh2_scp_send($connection, 'squid_acl/listip', $dato['path'].'/listip', 0644); + $stream = ssh2_exec($connection, $dato['command']); + } +} + ?> + diff --git a/proxy/squid_acl/listip b/proxy/squid_acl/listip index 8b13789..e69de29 100644 --- a/proxy/squid_acl/listip +++ b/proxy/squid_acl/listip @@ -1 +0,0 @@ -