From 5624039060c831d16bf7422bbfa8659539bd96d8 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Wed, 4 Aug 2010 23:59:42 -0600 Subject: Some minor fixes for gitsync. Don't create these unused directories, and make sure the file system is returned to the read-only state on NanoBSD. --- etc/phpshellsessions/gitsync | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'etc/phpshellsessions') diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index 1d95bc3..39c51ce 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -79,8 +79,6 @@ if($argv[4] == "NOBACKUP") else $nobackup = false; -exec("mkdir -p /root/pfsense/$BRANCHTAG"); - $found = false; foreach($branches as $branchname => $branchdesc) { if($branchname == $branch) @@ -103,6 +101,7 @@ if(!$found) { } if(!$found) { echo "\nNo valid branch found. Exiting.\n\n"; + conf_mount_ro(); exit; } } @@ -125,11 +124,13 @@ if(!$command_split[2] && !$argv[3]) { if($branch == "RESTORE" && $g['platform'] == "pfSense") { if(!file_exists("/root/cvssync_backup.tgz")) { echo "Sorry, we could not find a previous CVSSync backup file.\n"; + conf_mount_ro(); exit(); } echo "===> Restoring previous CVSSync backup... Please wait...\n"; exec("tar Uxpf /root/cvssync_backup.tgz -C /"); post_cvssync_commands(); + conf_mount_ro(); exit(); } else { $nobackup = true; // do not backup embedded, livecd @@ -145,7 +146,6 @@ if($nobackup == false) { } echo "===> Checking out $branch\n"; -exec("mkdir -p /root/pfsense/$branch"); // Git commands for resetting to the specified branch if($branch == "build_commit") { @@ -187,6 +187,7 @@ foreach($merge_repos as $merge_repo) { if($ret <> 0) { echo "\nMerge failed. Aborting sync.\n\n"; run_cmds($git_cmd); + conf_mount_ro(); exit; } } -- cgit v1.1