addInput(new Form_Select( fwbranch, 'Branch', get_repo_name($config['system']['pkg_repo_conf_path']), build_repo_list() ))->setHelp('Please select the stable, or the development branch from which to update the system firmware. ' . '
' . 'Use of the development version is at your own risk!'); $form->add($section); $section = new Form_Section('Updates'); $section->addInput(new Form_Checkbox( 'disablecheck', 'Dashboard check', 'Disable the automatic dashboard auto-update check', isset($curcfg['disablecheck']) )); $form->add($section); if (file_exists("/usr/local/bin/git")) { $section = new Form_Section('GitSync'); $section->addInput(new Form_Checkbox( 'synconupgrade', 'Auto sync on update', 'Enable repository/branch sync before reboot', isset($gitcfg['synconupgrade']) ))->setHelp('After updating, sync with the following repository/branch before reboot.'); if (is_dir("/root/pfsense/pfSenseGITREPO/pfSenseGITREPO")) { exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url", $output_str); if (is_array($output_str) && !empty($output_str[0])) { $lastrepositoryurl = $output_str[0]; } unset($output_str); } $section->addInput(new Form_Input( 'repositoryurl', 'Repository URL', 'text', ($gitcfg['repositoryurl'] ? $gitcfg['repositoryurl'] : '') ))->setHelp('The most recently used repository was %s. This repository will be used if the field is left blank.', [$lastrepositoryurl]); if (is_dir("/root/pfsense/pfSenseGITREPO/pfSenseGITREPO")) { exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git branch", $output_str); if (is_array($output_str)) { foreach ($output_str as $output_line) { if (strstr($output_line, '* ')) { $lastbranch = substr($output_line, 2); break; } } unset($output_str); } unset($output_str); } $section->addInput(new Form_Input( 'branch', 'Branch name', 'text', ($gitcfg['branch'] ? $gitcfg['branch'] : '') ))->setHelp('The most recently used branch was "%s". (Usually the branch name is master)' . '
Note: Sync will not be performed if a branch is not specified.', [$lastbranch]); $group = new Form_Group('Sync options'); $group->add(new Form_Checkbox( 'minimal', null, 'Minimal', isset($gitcfg['minimal']) ))->setHelp('Copy of only the updated files.'); $group->add(new Form_Checkbox( 'diff', null, 'Diff', isset($gitcfg['diff']) ))->setHelp('Copy of only the different or missing files.'); $group->add(new Form_Checkbox( 'show_files', null, 'Show Files', isset($gitcfg['show_files']) ))->setHelp('Show different and missing files.
With \'Diff/Minimal\' option..'); $group->add(new Form_Checkbox( 'show_command', null, 'Show Command', isset($gitcfg['show_command']) ))->setHelp('Show constructed command.
With \'Diff/Minimal\' option.'); $group->add(new Form_Checkbox( 'dryrun', null, 'Dry Run', isset($gitcfg['dryrun']) ))->setHelp('Dry-run only.
No files copied.'); $group->setHelp('See "playback gitsync --help" in console "PHP Shell + pfSense tools" for additional information.'); $section->add($group); $form->add($section); } // e-o-if (file_exists()) print($form); include("foot.inc");