Skip to content

Commit

Permalink
Make the force option auto pick the user/group
Browse files Browse the repository at this point in the history
  • Loading branch information
PadowYT2 authored Jan 20, 2024
1 parent 4e19992 commit 8483867
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions src/Commands/QuantumUninstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,52 +28,52 @@ public function handle()
$userDetails = posix_getpwuid(fileowner('public'));
$user = $userDetails['name'] ?? 'www-data';

$confirm = confirm(
label: "Your webserver user has been detected as <fg=green>[{$user}]:</> is this correct?",
default: true,
);

if (!$confirm) {
$user = select(
label: 'Please enter the name of the user running your webserver process. This varies from system to system, but is generally "www-data", "nginx", or "apache".',
options: [
'www-data' => 'www-data',
'nginx' => 'nginx',
'apache' => 'apache',
'own' => 'Your own user (type after you choose this)'
],
default: 'www-data'
);

if ($user === 'own')
$user = text('Please enter the name of the user running your webserver process');
}

$groupDetails = posix_getgrgid(filegroup('public'));
$group = $groupDetails['name'] ?? 'www-data';

$confirm = confirm(
label: "Your webserver group has been detected as <fg=green>[{$group}]:</> is this correct?",
default: true,
);

if (!$confirm) {
$user = select(
label: 'Please enter the name of the group running your webserver process. Normally this is the same as your user.',
options: [
'www-data' => 'www-data',
'nginx' => 'nginx',
'apache' => 'apache',
'own' => 'Your own group (type after you choose this)'
],
default: 'www-data'
if (!$this->option('force')) {
$confirm = confirm(
label: "Your webserver user has been detected as <fg=green>[{$user}]:</> is this correct?",
default: true,
);

if (!$confirm) {
$user = select(
label: 'Please enter the name of the user running your webserver process. This varies from system to system, but is generally "www-data", "nginx", or "apache".',
options: [
'www-data' => 'www-data',
'nginx' => 'nginx',
'apache' => 'apache',
'own' => 'Your own user (type after you choose this)'
],
default: 'www-data'
);

if ($user === 'own')
$user = text('Please enter the name of the user running your webserver process');
}

if ($user === 'own')
$user = text('Please enter the name of the group running your webserver process');
}
$confirm = confirm(
label: "Your webserver group has been detected as <fg=green>[{$group}]:</> is this correct?",
default: true,
);

if (!$confirm) {
$group = select(
label: 'Please enter the name of the group running your webserver process. Normally this is the same as your user.',
options: [
'www-data' => 'www-data',
'nginx' => 'nginx',
'apache' => 'apache',
'own' => 'Your own group (type after you choose this)'
],
default: 'www-data'
);

if ($group === 'own')
$group = text('Please enter the name of the group running your webserver process');
}

if (!$this->option('force')) {
$confirm = confirm(
label: 'You are about to uninstall Quantum. This process will removes all third party changes and updates Pterodactyl to the latest available version, do you wish to continue?',
default: false,
Expand Down

0 comments on commit 8483867

Please sign in to comment.