<?php
$campsite_dir = "/usr/local/campsite-tmp";
$bin_dir = "/usr/local/campsite-tmp/bin";
$etc_dir = "/usr/local/campsite-tmp/etc";
$www_dir = "/usr/local/campsite-tmp/www";
$www_common_dir = "/usr/local/campsite-tmp/www-common";
function get_dir_file_list($dir, $prefix, $recurse_dirs = -1, $root_dir = "")
{
if (($dh = opendir($dir)) == false) {
return "Invalid directory $dir";
}
if ($root_dir == "") {
$root_dir = $dir;
$local_dir = substr($dir, strlen($root_dir));
$file_path = "$prefix$local_dir";
echo "$file_pathn";
}
while (($file = readdir($dh)) !== false) {
if ($file[0] == '.' || is_link("$dir/$file")) {
continue;
}
$local_dir = substr($dir, strlen($root_dir));
$file_path = "$prefix$local_dir/$file";
if (is_dir("$dir/$file")) {
if ($recurse_dirs < 0 || $recurse_dirs > 0) {
echo "$file_pathn";
$result = get_dir_file_list("$dir/$file", $prefix, $recurse_dirs-1, $root_dir);
if ($result !== true) {
return $result;
}
}
continue;
}
echo "$file_pathn";
}
closedir($dh);
return true;
}
if (get_dir_file_list($campsite_dir, "%campsitedir", 0) !== true)
exit(1);
if (get_dir_file_list($bin_dir, "%_bindir") !== true)
exit(1);
if (get_dir_file_list($etc_dir, "%_sysconfdir", 0) !== true)
exit(1);
if (get_dir_file_list($www_dir, "%campsitewww", 0) !== true)
exit(1);
if (get_dir_file_list($www_common_dir, "%campsitewwwcommon") !== true)
exit(1);
if (get_dir_file_list("$campsite_dir/backup", "%campsitedir/backup") !== true)
exit(1);
if (get_dir_file_list("$campsite_dir/instance", "%campsitedir/instance") !== true)
exit(1);
?>