Revision 56240390
Added by Erik Fonnesbeck almost 15 years ago
etc/phpshellsessions/gitsync | ||
---|---|---|
79 | 79 |
else |
80 | 80 |
$nobackup = false; |
81 | 81 |
|
82 |
exec("mkdir -p /root/pfsense/$BRANCHTAG"); |
|
83 |
|
|
84 | 82 |
$found = false; |
85 | 83 |
foreach($branches as $branchname => $branchdesc) { |
86 | 84 |
if($branchname == $branch) |
... | ... | |
103 | 101 |
} |
104 | 102 |
if(!$found) { |
105 | 103 |
echo "\nNo valid branch found. Exiting.\n\n"; |
104 |
conf_mount_ro(); |
|
106 | 105 |
exit; |
107 | 106 |
} |
108 | 107 |
} |
... | ... | |
125 | 124 |
if($branch == "RESTORE" && $g['platform'] == "pfSense") { |
126 | 125 |
if(!file_exists("/root/cvssync_backup.tgz")) { |
127 | 126 |
echo "Sorry, we could not find a previous CVSSync backup file.\n"; |
127 |
conf_mount_ro(); |
|
128 | 128 |
exit(); |
129 | 129 |
} |
130 | 130 |
echo "===> Restoring previous CVSSync backup... Please wait...\n"; |
131 | 131 |
exec("tar Uxpf /root/cvssync_backup.tgz -C /"); |
132 | 132 |
post_cvssync_commands(); |
133 |
conf_mount_ro(); |
|
133 | 134 |
exit(); |
134 | 135 |
} else { |
135 | 136 |
$nobackup = true; // do not backup embedded, livecd |
... | ... | |
145 | 146 |
} |
146 | 147 |
|
147 | 148 |
echo "===> Checking out $branch\n"; |
148 |
exec("mkdir -p /root/pfsense/$branch"); |
|
149 | 149 |
|
150 | 150 |
// Git commands for resetting to the specified branch |
151 | 151 |
if($branch == "build_commit") { |
... | ... | |
187 | 187 |
if($ret <> 0) { |
188 | 188 |
echo "\nMerge failed. Aborting sync.\n\n"; |
189 | 189 |
run_cmds($git_cmd); |
190 |
conf_mount_ro(); |
|
190 | 191 |
exit; |
191 | 192 |
} |
192 | 193 |
} |
Also available in: Unified diff
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.