mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 22:44:50 +02:00
Fix detection of login shell from passwd
This commit is contained in:
@@ -125,7 +125,7 @@ using_id() {
|
||||
if [ -n "$cmd" ]; then
|
||||
output=$($cmd -P $USER 2>/dev/null)
|
||||
if [ $? = 0 ]; then
|
||||
login_shell=$(echo $output | cut -d: -f7);
|
||||
login_shell=$(echo $output | grep -o '[^:]*$');
|
||||
if login_shell_is_ok; then return 0; fi
|
||||
fi
|
||||
fi
|
||||
@@ -137,7 +137,7 @@ using_passwd() {
|
||||
if [ -n "$cmd" ]; then
|
||||
output=$($cmd "^$USER:" /etc/passwd 2>/dev/null)
|
||||
if [ $? = 0 ]; then
|
||||
login_shell=$(echo $output | cut -d: -f7);
|
||||
login_shell=$(echo $output | grep -o '[^:]*$');
|
||||
if login_shell_is_ok; then return 0; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user