mirror of
https://github.com/unraid/webgui.git
synced 2025-12-30 14:09:53 -06:00
refactor: streamline key installation feedback
- Simplified success messages in both PHP class and shell script after key installation. - Removed unnecessary conditional checks for array state, providing a more straightforward success response. This change aims to enhance clarity in user feedback during key installation. No further changes are pending for this task.
This commit is contained in:
@@ -60,16 +60,11 @@ class KeyInstaller
|
||||
exec("/usr/bin/wget -q -O " . escapeshellarg("/boot/config/$keyFile") . " " . escapeshellarg($url), $output, $returnVar);
|
||||
|
||||
if ($returnVar === 0) {
|
||||
exec("emcmd \"checkRegistration=Apply\"");
|
||||
$var = (array)@parse_ini_file('/var/local/emhttp/var.ini');
|
||||
if (_var($var, 'mdState') == "STARTED") {
|
||||
return $this->responseComplete(200, [
|
||||
'status' => 'success',
|
||||
'message' => _('Please Stop array to complete key installation'),
|
||||
]);
|
||||
} else {
|
||||
return $this->responseComplete(200, ['status' => 'success']);
|
||||
}
|
||||
exec('emcmd '.escapeshellarg('checkRegistration=Apply'));
|
||||
return $this->responseComplete(200, [
|
||||
'status' => 'success',
|
||||
'message' => _('Key installed'),
|
||||
]);
|
||||
} else {
|
||||
@unlink(escapeshellarg("/boot/config/$keyFile"));
|
||||
return $this->responseComplete(406, ['error' => _('download error') . " $returnVar"]);
|
||||
|
||||
@@ -34,12 +34,8 @@ if (in_array($host,['keys.lime-technology.com','lime-technology.com'])) {
|
||||
write("Downloading $keyfile ...\n");
|
||||
exec("/usr/bin/wget -q -O ".escapeshellarg("/boot/config/$key_file")." ".escapeshellarg($url), $output, $return_var);
|
||||
if ($return_var === 0) {
|
||||
exec("emcmd \"checkRegistration=Apply\"");
|
||||
if (parse_ini_file('/var/local/emhttp/var.ini')['mdState'] == 'STARTED') {
|
||||
write("Installing ... Please Stop array to complete key installation.\n");
|
||||
} else {
|
||||
write("Installed ...\n");
|
||||
}
|
||||
exec('emcmd '.escapeshellarg('checkRegistration=Apply'));
|
||||
write("Key installed ...\n");
|
||||
} else {
|
||||
write("ERROR: $return_var\n");
|
||||
switch($return_var) {
|
||||
|
||||
Reference in New Issue
Block a user