1
|
/* cvs_sync
|
2
|
* Written by Scott Ullrich
|
3
|
* (C)2005-2007 Scott Ullrich
|
4
|
* (C)2010-2012 Erik Fonnesbeck
|
5
|
* Part of the pfSense project pfSsh.php subsystem
|
6
|
*/
|
7
|
|
8
|
require_once("globals.inc");
|
9
|
require_once("filter.inc");
|
10
|
require_once("shaper.inc");
|
11
|
require_once("rrd.inc");
|
12
|
require_once("pfsense-utils.inc");
|
13
|
|
14
|
$GIT_PKG = "git"; // Either "git" or the full package URL
|
15
|
$GIT_BIN= "/usr/pbi/bin/git";
|
16
|
$GIT_REPO = "git://github.com/pfsense/pfsense.git";
|
17
|
$DEFAULT_BRANCH = "master";
|
18
|
$CODIR = "/root/pfsense";
|
19
|
$GITSYNC_MERGE = "/root/.gitsync_merge";
|
20
|
|
21
|
/* NOTE: Set branches here */
|
22
|
$branches = array(
|
23
|
"master" => "2.2 development branch",
|
24
|
"RELENG_2_1" => "2.1.* release branch",
|
25
|
"RELENG_2_0" => "2.0.* release branch",
|
26
|
"RELENG_1_2" => "1.2.* release branch",
|
27
|
"build_commit" => "The commit originally used to build the image"
|
28
|
);
|
29
|
|
30
|
global $g;
|
31
|
global $argv;
|
32
|
global $command_split;
|
33
|
|
34
|
if(is_array($command_split))
|
35
|
$temp_args = array_slice($command_split, 2);
|
36
|
else
|
37
|
$temp_args = array_slice($argv, 3);
|
38
|
|
39
|
$valid_args = array(
|
40
|
"--minimal" => "\tPerform a minimal copy of only the updated files.\n" .
|
41
|
"\tNot recommended if the system has files modified by any method other\n" .
|
42
|
"\tthan gitsync.\n",
|
43
|
"--help" => "\tDisplay this help list.\n"
|
44
|
);
|
45
|
$args = array();
|
46
|
$arg_count = 0;
|
47
|
while(!empty($temp_args)) {
|
48
|
$arg = array_shift($temp_args);
|
49
|
if($arg[0] == '-') {
|
50
|
switch($arg) {
|
51
|
case "--help":
|
52
|
echo "Usage: playback gitsync [options] [[repository] <branch>]\nOptions:\n";
|
53
|
foreach($valid_args as $arg_name => $arg_desc)
|
54
|
echo $arg_name . "\n" . $arg_desc;
|
55
|
exit;
|
56
|
case "--upgrading":
|
57
|
// Disables all interactive functions and neither PHP
|
58
|
// nor the web GUI will be killed or restarted.
|
59
|
$upgrading = true;
|
60
|
case (isset($valid_args[$arg])):
|
61
|
$args[$arg] = true;
|
62
|
break;
|
63
|
default:
|
64
|
echo "Invalid option: {$arg}\nUse --help for usage information.\n";
|
65
|
exit;
|
66
|
}
|
67
|
} else {
|
68
|
$args[$arg_count++] = $arg;
|
69
|
}
|
70
|
}
|
71
|
|
72
|
unlink_if_exists("/tmp/config.cache");
|
73
|
conf_mount_rw();
|
74
|
|
75
|
if(!file_exists($GIT_BIN)) {
|
76
|
echo "Cannot find git, fetching...\n";
|
77
|
require_once("config.inc");
|
78
|
require_once("util.inc");
|
79
|
require_once("pkg-utils.inc");
|
80
|
|
81
|
echo "Trying to fetch package info...";
|
82
|
$pkg_info = get_pkg_info();
|
83
|
if ($pkg_info) {
|
84
|
echo " Done.\n";
|
85
|
} else {
|
86
|
$xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl'];
|
87
|
echo "\n" . sprintf(gettext(' >>> Unable to communicate with %1$s. Please verify DNS and interface configuration, and that %2$s has functional Internet connectivity.'), $xmlrpc_base_url, $g['product_name']) . "\n";
|
88
|
return;
|
89
|
}
|
90
|
if (empty($pkg_info["git"])) {
|
91
|
echo "Can't locate git package in pfSense repo. Using FreeBSD pkg repo..";
|
92
|
|
93
|
if (($g['platform'] == "nanobsd")) {
|
94
|
$pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ ";
|
95
|
$pkgstagingdir = "/root/tmp";
|
96
|
if (!is_dir($pkgstagingdir))
|
97
|
mkdir($pkgstagingdir);
|
98
|
$pkgstaging = "-t {$pkgstagingdir}/instmp.XXXXXX";
|
99
|
}
|
100
|
system("{$pkgtmpdir}/usr/sbin/pkg_add {$pkgstaging} -r {$GIT_PKG}");
|
101
|
|
102
|
} else {
|
103
|
install_package("git", $pkg_info["git"], true);
|
104
|
echo "Done.\n";
|
105
|
}
|
106
|
}
|
107
|
|
108
|
# Remove mainline if exists (older)
|
109
|
if(is_dir("/root/pfsense/mainline"))
|
110
|
exec("rm -rf /root/pfsense/mainline");
|
111
|
|
112
|
# Remove RELENG_1_2 if exists (older)
|
113
|
if(is_dir("/root/pfsense/RELENG_1_2"))
|
114
|
exec("rm -rf /root/pfsense/RELENG_1_2");
|
115
|
|
116
|
# Remove HEAD if exists (older)
|
117
|
if(is_dir("/root/pfsense/HEAD"))
|
118
|
exec("rm -rf /root/pfsense/HEAD");
|
119
|
|
120
|
if(file_exists("/root/cvssync_backup.tgz")) {
|
121
|
$backup_date = `ls -lah /root/cvssync_backup.tgz | awk '{ print $6,$7,$8 }'`;
|
122
|
$tmp = array("RESTORE" => "Restores prior CVSSync backup data performed at {$backup_date}");
|
123
|
$branches = array_merge($branches, $tmp);
|
124
|
}
|
125
|
|
126
|
if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
|
127
|
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} config remote.origin.url", $output_str, $ret);
|
128
|
if(is_array($output_str) && !empty($output_str[0]))
|
129
|
$GIT_REPO = $output_str[0];
|
130
|
unset($output_str);
|
131
|
}
|
132
|
|
133
|
if(!$args[0] && !$upgrading) {
|
134
|
echo "\nCurrent repository is $GIT_REPO\n";
|
135
|
echo "\nPlease select which branch you would like to sync against:\n\n";
|
136
|
foreach($branches as $branchname => $branchdesc) {
|
137
|
echo "{$branchname} \t {$branchdesc}\n";
|
138
|
}
|
139
|
echo "\nOr alternatively you may enter a custom RCS branch URL (Git or HTTP).\n\n";
|
140
|
$branch = readline("> ");
|
141
|
echo "\n";
|
142
|
} else {
|
143
|
$branch = $args[0];
|
144
|
}
|
145
|
|
146
|
if($args[1] == "NOBACKUP")
|
147
|
$nobackup = true;
|
148
|
else
|
149
|
$nobackup = false;
|
150
|
|
151
|
// If the repository has been fetched before, build a list of its branches.
|
152
|
if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
|
153
|
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} branch -r", $branch_list, $ret);
|
154
|
if($ret == 0 && is_array($branch_list)) {
|
155
|
foreach ($branch_list as $branch_item) {
|
156
|
$branch_item = substr(strrchr($branch_item, "/"), 1);
|
157
|
if (!isset($branches[$branch_item]))
|
158
|
$branches[$branch_item] = " ";
|
159
|
}
|
160
|
}
|
161
|
}
|
162
|
|
163
|
$found = false;
|
164
|
foreach($branches as $branchname => $branchdesc) {
|
165
|
if($branchname == $branch)
|
166
|
$found = true;
|
167
|
}
|
168
|
if(!$found) {
|
169
|
if(isURL($branch) && !$upgrading) {
|
170
|
if($args[1]) {
|
171
|
$GIT_REPO = $branch;
|
172
|
$branch = $args[1];
|
173
|
$found = true;
|
174
|
}
|
175
|
else {
|
176
|
echo "\n";
|
177
|
echo "NOTE: $branch was not found.\n\n";
|
178
|
$command = readline("Is this a custom GIT URL? [y]? ");
|
179
|
if(strtolower($command) == "y" or $command == "") {
|
180
|
$GIT_REPO = $branch;
|
181
|
$command = readline("Checkout which branch [${DEFAULT_BRANCH}]? ");
|
182
|
if($command == "")
|
183
|
$branch = $DEFAULT_BRANCH;
|
184
|
if($command)
|
185
|
$branch = $command;
|
186
|
$found = true;
|
187
|
}
|
188
|
}
|
189
|
}
|
190
|
if(!$found) {
|
191
|
echo "\nNo valid branch found. Exiting.\n\n";
|
192
|
conf_mount_ro();
|
193
|
exit;
|
194
|
}
|
195
|
}
|
196
|
|
197
|
$merge_repos = array();
|
198
|
if(file_exists($GITSYNC_MERGE)) {
|
199
|
$gitsync_merges = file($GITSYNC_MERGE, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
200
|
if(!empty($gitsync_merges) && is_array($gitsync_merges)) {
|
201
|
echo "\n===> Automatic merge list read from ${GITSYNC_MERGE}\n";
|
202
|
foreach($gitsync_merges as $merge_line_num => $merge_line) {
|
203
|
$merge_comments = explode("#", trim($merge_line));
|
204
|
if(empty($merge_comments[0]))
|
205
|
continue;
|
206
|
|
207
|
$merge_line = explode(" ", trim($merge_comments[0]));
|
208
|
if(count($merge_line) != 2 || empty($merge_line[0]) || empty($merge_line[1])) {
|
209
|
echo "\nLine " . ($merge_line_num + 1) . " does not have the correct parameter count or has improper spacing.\n";
|
210
|
echo "Expected parameters: repository_url branch\n";
|
211
|
echo "Line read: " . implode(" ", $merge_line) . "\n\n";
|
212
|
echo "Aborting automatic merge.\n\n";
|
213
|
$merge_repos = array();
|
214
|
break;
|
215
|
}
|
216
|
$merge_repos[] = array('repo' => $merge_line[0], 'branch' => $merge_line[1]);
|
217
|
}
|
218
|
}
|
219
|
}
|
220
|
if(!$args[0] && !$upgrading) {
|
221
|
do {
|
222
|
echo "\nAdd a custom RCS branch URL (Git or HTTP) to merge in or press enter if done.\n\n";
|
223
|
$merge_repo = readline("> ");
|
224
|
if(!empty($merge_repo)) {
|
225
|
$merge_branch = readline("Merge which branch [${DEFAULT_BRANCH}]? ");
|
226
|
if($merge_branch == "")
|
227
|
$merge_repos[] = array('repo' => $merge_repo, 'branch' => $DEFAULT_BRANCH);
|
228
|
else if($merge_branch)
|
229
|
$merge_repos[] = array('repo' => $merge_repo, 'branch' => $merge_branch);
|
230
|
}
|
231
|
} while(!empty($merge_repo));
|
232
|
}
|
233
|
|
234
|
if($branch == "RESTORE" && $g['platform'] == "pfSense") {
|
235
|
if(!file_exists("/root/cvssync_backup.tgz")) {
|
236
|
echo "Sorry, we could not find a previous CVSSync backup file.\n";
|
237
|
conf_mount_ro();
|
238
|
exit();
|
239
|
}
|
240
|
echo "===> Restoring previous CVSSync backup... Please wait...\n";
|
241
|
exec("tar Uxpf /root/cvssync_backup.tgz -C /");
|
242
|
post_cvssync_commands();
|
243
|
conf_mount_ro();
|
244
|
exit();
|
245
|
} else {
|
246
|
$nobackup = true; // do not backup embedded, livecd
|
247
|
}
|
248
|
|
249
|
if($nobackup == false) {
|
250
|
echo "===> Backing up current pfSense information...\n";
|
251
|
echo "===> Please wait... ";
|
252
|
exec("tar czPf /root/cvssync_backup.tgz --exclude /root --exclude /dev --exclude /var/db/racoon/racoon.sock --exclude /tmp --exclude /var/run --exclude /var/empty /");
|
253
|
$size = filesize("/root/cvssync_backup.tgz");
|
254
|
echo "{$size} bytes.\n\n";
|
255
|
sleep(5);
|
256
|
}
|
257
|
|
258
|
echo "===> Checking out $branch\n";
|
259
|
|
260
|
// Git commands for resetting to the specified branch
|
261
|
if($branch == "build_commit") {
|
262
|
$git_cmd = array(
|
263
|
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} branch " . escapeshellarg($branch) . " 2>/dev/null",
|
264
|
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} checkout -f " . escapeshellarg($branch) . " 2>/dev/null",
|
265
|
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} reset --hard " . escapeshellarg(trim(file_get_contents("/etc/version.lastcommit")))
|
266
|
);
|
267
|
} else {
|
268
|
$git_cmd = array(
|
269
|
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} branch " . escapeshellarg($branch) . " " . escapeshellarg("origin/{$branch}") . " 2>/dev/null",
|
270
|
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} checkout -f " . escapeshellarg($branch) . " 2>/dev/null",
|
271
|
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} reset --hard " . escapeshellarg("origin/{$branch}")
|
272
|
);
|
273
|
}
|
274
|
|
275
|
// Git 'er done!
|
276
|
if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
|
277
|
echo "===> Fetching updates...\n";
|
278
|
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} config remote.origin.url " . escapeshellarg($GIT_REPO));
|
279
|
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} fetch");
|
280
|
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} clean -f -f -x -d");
|
281
|
run_cmds($git_cmd);
|
282
|
} else {
|
283
|
exec("mkdir -p $CODIR/pfSenseGITREPO");
|
284
|
echo "Executing cd $CODIR/pfSenseGITREPO && {$GIT_BIN} clone $GIT_REPO pfSenseGITREPO\n";
|
285
|
exec("cd $CODIR/pfSenseGITREPO && {$GIT_BIN} clone " . escapeshellarg($GIT_REPO) . " pfSenseGITREPO");
|
286
|
if(is_dir("$CODIR/pfSenseGITREPO/pfSense"))
|
287
|
exec("mv $CODIR/pfSenseGITREPO/pfSense $CODIR/pfSenseGITREPO/pfSenseGITREPO");
|
288
|
if(is_dir("$CODIR/pfSenseGITREPO/mainline"))
|
289
|
exec("mv $CODIR/pfSenseGITREPO/mainline $CODIR/pfSenseGITREPO/pfSenseGITREPO");
|
290
|
run_cmds($git_cmd);
|
291
|
}
|
292
|
|
293
|
foreach($merge_repos as $merge_repo) {
|
294
|
echo "===> Merging branch {$merge_repo['branch']} from {$merge_repo['repo']}\n";
|
295
|
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} pull " . escapeshellarg($merge_repo['repo']) . " " . escapeshellarg($merge_repo['branch']), $output_str, $ret);
|
296
|
unset($output_str);
|
297
|
if($ret <> 0) {
|
298
|
echo "\nMerge failed. Aborting sync.\n\n";
|
299
|
run_cmds($git_cmd);
|
300
|
conf_mount_ro();
|
301
|
exit;
|
302
|
}
|
303
|
}
|
304
|
|
305
|
if(isset($args["--minimal"])) {
|
306
|
if(file_exists("/etc/version.gitsync"))
|
307
|
$old_revision = trim(file_get_contents("/etc/version.gitsync"));
|
308
|
else if(file_exists("/etc/version.lastcommit"))
|
309
|
$old_revision = trim(file_get_contents("/etc/version.lastcommit"));
|
310
|
$files_to_copy = strtr(shell_exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} diff --name-only " . escapeshellarg($old_revision)), "\n", " ");
|
311
|
} else
|
312
|
$files_to_copy = '--exclude .git .';
|
313
|
|
314
|
// Save new commit ID for later minimal file copies
|
315
|
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} rev-parse -q --verify HEAD > /etc/version.gitsync");
|
316
|
|
317
|
exec("mkdir -p /tmp/lighttpd/cache/compress/");
|
318
|
|
319
|
// Nuke CVS and pfSense tarballs
|
320
|
exec("cd ${CODIR}/pfSenseGITREPO/pfSenseGITREPO && find . -name CVS -exec rm -rf {} \; 2>/dev/null");
|
321
|
exec("cd ${CODIR}/pfSenseGITREPO/pfSenseGITREPO && find . -name pfSense.tgz -exec rm {} \; 2>/dev/null");
|
322
|
|
323
|
// Remove files that we do not want to overwrite the system with
|
324
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/crontab 2>/dev/null");
|
325
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/master.passwd 2>/dev/null");
|
326
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/passwd 2>/dev/null");
|
327
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/fstab 2>/dev/null");
|
328
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/ttys 2>/dev/null");
|
329
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/group 2>/dev/null");
|
330
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/fstab 2>/dev/null");
|
331
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/platform 2>/dev/null");
|
332
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/boot/device.hints 2>/dev/null");
|
333
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/boot/loader.conf 2>/dev/null");
|
334
|
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/boot/loader.rc 2>/dev/null");
|
335
|
exec("rm -rf ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/conf*");
|
336
|
exec("rm -rf ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/cf 2>/dev/null");
|
337
|
exec("rm -rf ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/root/.shrc");
|
338
|
exec("rm -rf ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/root/.tcshrc");
|
339
|
exec("rm -f ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/syslog.conf 2>/dev/null");
|
340
|
|
341
|
echo "===> Installing new files...\n";
|
342
|
|
343
|
if($g['platform'] == "pfSense")
|
344
|
$command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - {$files_to_copy} | (cd / ; tar -Uxpf -)";
|
345
|
else
|
346
|
$command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - {$files_to_copy} | (cd / ; tar -xpf -) 2>/dev/null";
|
347
|
if(!empty($files_to_copy))
|
348
|
exec($command);
|
349
|
else {
|
350
|
echo "Already up-to-date.\n";
|
351
|
$upgrading = true;
|
352
|
}
|
353
|
|
354
|
// Reset the repository to restore the deleted files
|
355
|
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && {$GIT_BIN} reset --hard >/dev/null 2>/dev/null");
|
356
|
|
357
|
// Remove obsolete files
|
358
|
$files_to_remove = file("/etc/pfSense.obsoletedfiles");
|
359
|
foreach($files_to_remove as $file_to_remove)
|
360
|
if(file_exists($file_to_remove))
|
361
|
exec("/bin/rm -f $file_to_remove");
|
362
|
|
363
|
if(!$upgrading)
|
364
|
post_cvssync_commands();
|
365
|
|
366
|
echo "===> Checkout complete.\n";
|
367
|
echo "\n";
|
368
|
if(!$upgrading)
|
369
|
echo "Your system is now sync'd and PHP and Lighty will be restarted in 5 seconds.\n\n";
|
370
|
else
|
371
|
echo "Your system is now sync'd.\n\n";
|
372
|
|
373
|
function post_cvssync_commands() {
|
374
|
echo "===> Removing FAST-CGI temporary files...\n";
|
375
|
exec("find /tmp -name \"php-fastcgi.socket*\" -exec rm -rf {} \;");
|
376
|
exec("find /tmp -name \"*.tmp\" -exec rm -rf {} \;");
|
377
|
|
378
|
exec("rm -rf /tmp/xcache/* 2>/dev/null");
|
379
|
|
380
|
echo "===> Upgrading configuration (if needed)...\n";
|
381
|
convert_config();
|
382
|
|
383
|
echo "===> Configuring filter...";
|
384
|
exec("/etc/rc.filter_configure_sync");
|
385
|
exec("pfctl -f /tmp/rules.debug");
|
386
|
echo "\n";
|
387
|
|
388
|
if(file_exists("/etc/rc.php_ini_setup")) {
|
389
|
echo "===> Running /etc/rc.php_ini_setup...";
|
390
|
exec("/etc/rc.php_ini_setup");
|
391
|
echo "\n";
|
392
|
}
|
393
|
|
394
|
/* lock down console if necessary */
|
395
|
echo "===> Locking down the console if needed...\n";
|
396
|
auto_login();
|
397
|
|
398
|
echo "===> Signaling PHP and Lighty restart...";
|
399
|
$fd = fopen("/tmp/restart_lighty", "w");
|
400
|
fwrite($fd, "#!/bin/sh\n");
|
401
|
fwrite($fd, "sleep 5\n");
|
402
|
fwrite($fd, "/usr/local/sbin/pfSctl -c 'service restart webgui'\n");
|
403
|
if(file_exists("/var/etc/lighty-CaptivePortal.conf"))
|
404
|
fwrite($fd, "/usr/local/sbin/lighttpd -f /var/etc/lighty-CaptivePortal.conf\n");
|
405
|
fclose($fd);
|
406
|
mwexec_bg("sh /tmp/restart_lighty");
|
407
|
echo "\n";
|
408
|
|
409
|
}
|
410
|
|
411
|
function isUrl($url = "") {
|
412
|
if($url)
|
413
|
if(strstr($url, "rcs.pfsense.org") or
|
414
|
strstr($url, "mainline") or
|
415
|
strstr($url, ".git") or strstr($url, "git://"))
|
416
|
return true;
|
417
|
return false;
|
418
|
}
|
419
|
|
420
|
function run_cmds($cmds) {
|
421
|
global $debug;
|
422
|
foreach($cmds as $cmd) {
|
423
|
if($debug)
|
424
|
echo "Running $cmd";
|
425
|
exec($cmd);
|
426
|
}
|
427
|
}
|
428
|
|
429
|
conf_mount_ro();
|