diff options
Diffstat (limited to 'usr/local/share/pfSense/post_upgrade_command.php')
-rwxr-xr-x | usr/local/share/pfSense/post_upgrade_command.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/usr/local/share/pfSense/post_upgrade_command.php b/usr/local/share/pfSense/post_upgrade_command.php new file mode 100755 index 0000000..c2b6901 --- /dev/null +++ b/usr/local/share/pfSense/post_upgrade_command.php @@ -0,0 +1,31 @@ +#!/usr/local/bin/php -f +<?php + + /* upgrade embedded users serial console */ + require_once("globals.inc"); + require_once("config.inc"); + require_once("functions.inc"); + + if (file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) { + if (!empty($config['system']['gitsync']['repositoryurl'])) { + exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl'])); + } + if (!empty($config['system']['gitsync']['branch'])) { + system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading"); + } + } + + $newslicedir = ""; + if (isset($argv[1]) && $argv[1] != "") { + $newslicedir = '/tmp/' . $argv[1]; + } + + if ($g['enableserial_force'] || file_exists("{$newslicedir}/enableserial_force")) { + $config['system']['enableserial'] = true; + write_config(); + } + + system("echo \"Adding serial port settings ({$newslicedir})...\" >> /conf/upgrade_log.txt"); + setup_serial_port("upgrade", $newslicedir); + +?> |