ssh kitten: Look in common locations for login shell if it is not in PATH
This commit is contained in:
parent
7f69381221
commit
4c74462763
@ -198,6 +198,20 @@ prepare_for_exec() {
|
|||||||
install_kitty_bootstrap
|
install_kitty_bootstrap
|
||||||
|
|
||||||
[ -n "$login_shell" ] || using_getent || using_id || using_python || using_perl || using_passwd || using_shell_env || login_shell="sh"
|
[ -n "$login_shell" ] || using_getent || using_id || using_python || using_perl || using_passwd || using_shell_env || login_shell="sh"
|
||||||
|
case "$login_shell" in
|
||||||
|
/*) ;;
|
||||||
|
*)
|
||||||
|
if ! command -v "$login_shell" > /dev/null 2> /dev/null; then
|
||||||
|
for i in /opt/homebrew/bin /opt/homebrew/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin
|
||||||
|
do
|
||||||
|
if [ -x "$i/$login_shell" ]; then
|
||||||
|
login_shell="$i/$login_shell"
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
shell_name=$(command basename $login_shell)
|
shell_name=$(command basename $login_shell)
|
||||||
[ -n "$login_cwd" ] && cd "$login_cwd"
|
[ -n "$login_cwd" ] && cd "$login_cwd"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user