/lib/fs/etc/cron.daily/iardumper |
@@ -46,24 +46,6 @@ |
// INTERNALS // |
///////////////////////////////////////////////////////////// |
|
/////////////////////////////////////////////////////////////////////////// |
// Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // |
/////////////////////////////////////////////////////////////////////////// |
function wasChown($path, $uid, $gid) { |
switch(filetype($path)) { |
case 'dir': |
if(($dir = opendir($path)) === false) break; |
while(false !== ($file = readdir($dir))) { |
if($file == '.' || $file == '..') continue; |
wasChown($path.'/'.$file, $uid, $gid); |
} |
case 'file': |
chown($path, $uid); |
chgrp($path, $gid); |
break; |
} |
} |
|
require_once('/var/www/lib/wasRemoteAdmin.php'); |
|
if(!defined('STDIN')) { |
@@ -98,7 +80,7 @@ |
array_shift($argv); |
|
// Create the request |
$req = new wasRemoteAdmin('http://localhost:10000', 'opensim'); |
$req = new KOS('http://localhost:10000', 'opensim'); |
|
// ..and dump |
foreach($users as $user) { |
@@ -105,7 +87,6 @@ |
$_user = preg_replace('/\s/','_',$user); |
$USER_FOLDER='/var/lib/iar/'.$_user; |
if(!is_dir($USER_FOLDER)) mkdir($USER_FOLDER); |
wasChown($USER_FOLDER, 'opensim', 'opensim'); |
$req->admin_console_command('save iar '.$user.' /* '.$USER_FOLDER.'/'.$_user.'.iar'); |
wasChown($USER_FOLDER, 'www-data', 'www-data'); |
chown($USER_FOLDER, 'opensim'); |
$req->send('save iar '.$user.' / '.$USER_FOLDER.'/'.$_user.'.iar'); |
} |