#!/usr/bin/php -q 'http://localhost/pub/changes?buffer_length=1', CURLOPT_UNIX_SOCKET_PATH => '/var/run/nginx.socket', CURLOPT_POST => 1, CURLOPT_RETURNTRANSFER => true ]); foreach ($messages as $message) { curl_setopt($com, CURLOPT_POSTFIELDS, $message); curl_exec($com); } curl_close($com); } unset($argv[$argc-1]); // remove nchan parameter $file = $argv[1]; $path = realpath('/etc/wireguard'.($argv[2]??'')); $root = '/boot/config/wireguard'; $style = [""; $script = [""; $html = []; $html[] = "

".($argv[2] ? _('Remote peer configuration') : _('Local server configuration'))."

"; $html[] = "
"; $html[] = "
";
$html[] = @file_get_contents("$path/$file.conf");
$html[] = "\n";
$html[] = "
"; if (is_file("$path/$file.png")) { @unlink("$docroot/$file.png"); symlink("$path/$file.png", "$docroot/$file.png"); $html[] = ""; } write(implode($style).implode($script).implode($html),'_DONE_',''); ?>