1
|
#!/usr/local/bin/php -f
|
2
|
<?php
|
3
|
|
4
|
/* upgrade embedded users serial console */
|
5
|
require_once("globals.inc");
|
6
|
require_once("config.inc");
|
7
|
require_once("functions.inc");
|
8
|
|
9
|
if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) {
|
10
|
if(!empty($config['system']['gitsync']['repositoryurl']))
|
11
|
exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl']));
|
12
|
if(!empty($config['system']['gitsync']['branch']))
|
13
|
system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading");
|
14
|
}
|
15
|
|
16
|
$newslicedir = "";
|
17
|
if (isset($argv[1]) && $argv[1] != "")
|
18
|
$newslicedir = '/tmp/' . $argv[1];
|
19
|
|
20
|
if($g['enableserial_force'] || file_exists("{$newslicedir}/enableserial_force")) {
|
21
|
$config['system']['enableserial'] = true;
|
22
|
write_config();
|
23
|
}
|
24
|
|
25
|
system("echo \"Adding serial port settings ({$newslicedir})...\" >> /conf/upgrade_log.txt");
|
26
|
setup_serial_port("upgrade", $newslicedir);
|
27
|
|
28
|
?>
|