#!/usr/bin/php $value) { $iniString .= "$key=\"$value\"\n"; } /* Write the INI string to the plugin config file. */ file_put_contents(PLG_CONFIG_FILE, $iniString); /* Let things settle. */ sleep(1); /* Now run the proxy setup script. */ $set_proxy = "/usr/local/emhttp/plugins/dynamix/scripts/set_proxy"; if (is_executable($set_proxy)) { exec($set_proxy." 1>/dev/null"); outgoingproxy_log("'set_proxy' script executed"); } else { outgoingproxy_log("'set_proxy' script does not exist"); } } /* Main entry point, */ switch ($argv[1]) { case 'apply': apply(); break; default: echo("Error: 'outgoingproxy {$argv[1]}' not understood\n"); echo("outgoingproxy usage: 'apply'\n"); exit(0); break; } ?>