function squid_z_reconfigure() { SQUID_REFRESH_PANEL_STATUS(); $unix = new unix(); $php5 = $unix->LOCATE_PHP5_BIN(); $nohup = $unix->find_program("nohup"); $force = null; if (isset($_GET["force"])) { $force = " --force"; } shell_exec("{$nohup} {$php5} /usr/share/artica-postfix/exec.squid.watchdog.php --squidz{$force} >> {$GLOBALS["SQUID_REFRESH_PANEL_STATUS"]} 2>&1 &"); }
function SQUID_RESTART_ONLY() { $unix = new unix(); $nohup = null; $php = $unix->LOCATE_PHP5_BIN(); $nohup = $unix->find_program("nohup") . " "; $force = null; SQUID_REFRESH_PANEL_STATUS(); if (isset($_GET["force"])) { $force = " --force"; } writelogs_framework("Force = `{$force}`", __FUNCTION__, __FILE__, __LINE__); writelogs_framework("ApplyConfToo = `{$_GET["ApplyConfToo"]}`", __FUNCTION__, __FILE__, __LINE__); writelogs_framework("SQUID_REFRESH_PANEL_STATUS = `{$_GET["SQUID_REFRESH_PANEL_STATUS"]}`", __FUNCTION__, __FILE__, __LINE__); if (isset($_GET["ApplyConfToo"])) { if (is_file("/etc/init.d/artica-memcache")) { $cmd = "{$nohup} /etc/init.d/artica-memcache >/dev/null 2>&1"; writelogs_framework($cmd, __FUNCTION__, __FILE__, __LINE__); shell_exec($nohup . $cmd); } $cmd = "{$nohup} /etc/init.d/ufdb start --framework {$force} >> {$GLOBALS["SQUID_REFRESH_PANEL_STATUS"]} 2>&1 &"; writelogs_framework("{$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); $cmd = "{$nohup} {$php} /usr/share/artica-postfix/exec.squid.watchdog.php --restart --reconfigure --framework {$force} >> {$GLOBALS["SQUID_REFRESH_PANEL_STATUS"]} 2>&1 &"; writelogs_framework("{$cmd}", __FUNCTION__, __FILE__, __LINE__); @file_put_contents($GLOBALS["SQUID_REFRESH_PANEL_STATUS"], $cmd . "\n"); shell_exec($cmd); return; } $f[] = "#!/bin/sh"; $f[] = "/etc/init.d/squid restart{$force} --framework >> {$GLOBALS["SQUID_REFRESH_PANEL_STATUS"]} 2>&1"; $f[] = "/etc/init.d/dnsmasq restart{$force} --framework >> {$GLOBALS["SQUID_REFRESH_PANEL_STATUS"]} 2>&1"; @file_put_contents("/tmp/squid.restart.sh", @implode("\n", $f)); @chmod("/tmp/squid.restart.sh", 0755); writelogs_framework("{$nohup} /tmp/squid.restart.sh >/dev/null 2>&1 &", __FUNCTION__, __FILE__, __LINE__); shell_exec("{$nohup} /tmp/squid.restart.sh >/dev/null 2>&1 &"); }
function firewall() { SQUID_REFRESH_PANEL_STATUS(); $unix = new unix(); $php5 = $unix->LOCATE_PHP5_BIN(); $nohup = $unix->find_program("nohup"); if (!is_file("/etc/init.d/tproxy start")) { shell_exec("{$nohup} {$php5} /usr/share/artica-postfix/exec.squid.transparent.php >> {$GLOBALS["SQUID_REFRESH_PANEL_STATUS"]} 2>&1 &"); } else { shell_exec("{$nohup} /etc/init.d/tproxy start >> {$GLOBALS["SQUID_REFRESH_PANEL_STATUS"]} 2>&1 &"); } }