diff --git a/etc/phpshellsessions/cvssync b/etc/phpshellsessions/cvssync index 5edbc9fe4d..cbcfba5476 100644 --- a/etc/phpshellsessions/cvssync +++ b/etc/phpshellsessions/cvssync @@ -58,6 +58,7 @@ if($command_split[2]) { foreach($branches as $branchname => $branchdesc) { echo "{$branchname} \t {$branchdesc}\n"; } + echo "\nOr alternatively you may enter a custom branch URL.\n\n"; $branch = readline("> "); echo "\n"; } else { @@ -78,8 +79,20 @@ foreach($branches as $branchname => $branchdesc) { $found = true; } if(!$found) { - echo "\nInvalid branch.\n"; - exit; + if(isURL($branch)) { + echo "\n"; + echo "NOTE: $branch was not found.\n\n"; + $command = readline("Is this a custom branch URL? [y]? "); + if(strtolower($command) == "y" or $command == "") { + $GIT_REPO = $branch; + $branch = "master"; + $found = true; + } + } + if(!$found) { + echo "\nNo valid branch found. Exiting.\n\n"; + exit; + } } if($branch == "RESTORE" && $g['platform'] == "pfSense") { @@ -196,4 +209,11 @@ function post_cvssync_commands() { echo "\n"; } +function isUrl($url = "") { + if($url) + if(strstr($url, "rcs.pfsense.org") or strstr($url, "mainline")) + return true; + return false; +} + conf_mount_ro();