mirror of
https://github.com/unraid/webgui.git
synced 2026-04-23 10:38:50 -05:00
MVP solution for zsh plugin
Implemented a minimal viable solution for the zsh plugin: - Checks if the shell is /bin/zsh - Falls back to bash if not This approach prioritizes simplicity and reliability over a more general solution to avoid potential errors.
This commit is contained in:
@@ -51,9 +51,8 @@ case 'ttyd':
|
||||
// no child processes, restart ttyd to pick up possible font size change
|
||||
if ($retval != 0) exec("kill ".$ttyd_pid[0]);
|
||||
}
|
||||
$userShell = basename(posix_getpwuid(0)['shell']);
|
||||
$shell = in_array($userShell, ['bash', 'sh', 'zsh', 'fish', 'ksh', 'tcsh', 'dash']) ? $userShell : 'bash';
|
||||
if ($retval != 0) exec("ttyd-exec -i '$sock' $shell --login");
|
||||
$shell = posix_getpwuid(0)['shell'] === '/bin/zsh' ? 'zsh' : 'bash';
|
||||
if ($retval != 0) exec("ttyd-exec -i '$sock' '$shell' --login");
|
||||
break;
|
||||
case 'syslog':
|
||||
// read syslog file
|
||||
|
||||
Reference in New Issue
Block a user