} $so = basename($file); if (!isset($allLib[$so])) { zexec("rm {$file}"); } } foreach ($runDirs as $runDir) { exec("find {$basePath}/run/{$runDir} -name '*'", $files); foreach ($files as $file) { if (is_dir($file) or !file_exists($file)) { continue; } exec("ldd {$file}", $ldds, $result); if (!$result) { echo `/root/bin/patchelf --set-rpath {$basePath}/run/lib/ {$file}`; } } } foreach ($interpreters as $interpreter) { $interpreterName = basename($interpreter); zexec("cp {$interpreter} {$basePath}/run/lib/{$interpreterName}"); } zexec("ln -s {$basePath}/run/apache/apachectl {$basePath}/bin/"); zexec("ln -s {$basePath}/run/apache/htpasswd {$basePath}/bin/"); zexec("ln -s {$basePath}/run/apache/httpd {$basePath}/bin/"); zexec("ln -s {$basePath}/run/mysql/mysqld_safe {$basePath}/bin/"); zexec("ln -s {$basePath}/run/mysql/mysql.server {$basePath}/bin/"); zexec("ln -s {$basePath}/run/mysql/mysql {$basePath}/bin/"); zexec("ln -s {$basePath}/run/php/php {$basePath}/bin/"); zexec("rm {$basePath}/apachefinish {$basePath}/mysqlfinish {$basePath}/phpfinish");
function usermod($user) { $PASS = $user->pass; $USER = $user->user; $SHELL = $user->shell; $HOME = $user->home; $pass_crypted = crypt($PASS); zexec("usermod -d {$HOME} -s {$SHELL} -p '{$pass_crypted}' {$USER}", 'Updating user...'); zexec("chmod 711 {$HOME}", "Fixing home directory ownership..."); }