proxy remoti
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user