Use sudo rm --recursive for /srv/niver/ht/username

This commit is contained in:
Miraty 2022-09-06 02:23:59 +02:00
parent e7b2856f92
commit 72f4ce3605
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ if (processForm()) {
removeDirectory(CONF['ht']['tor_config_path'] . '/' . $_SESSION['username']);
removeDirectory(CONF['ht']['ht_path'] . '/' . $_SESSION['username']);
exec(CONF['ht']['sudo_path'] . ' ' . CONF['ht']['rm_path'] . ' --recursive ' . CONF['ht']['ht_path'] . '/' . $_SESSION['username'], result_code: $code);
if ($code !== 0)
serverError("Can't remove user's directory.");
query('delete', 'users', ['username' => $_SESSION['username']]);