environment/bin/shell
2025-08-01 12:52:57 +02:00

17 lines
348 B
Bash
Executable file

#!/bin/bash
# Try to get home directory safely
USER_HOME=$(getent passwd "$USER" | cut -d: -f6)
MYZSH="$USER_HOME/.local/bin/zsh"
if [ -x "$MYZSH" ]; then
echo "user own shell"
exec "$MYZSH" -i
elif command -v zsh >/dev/null 2>&1; then
echo "system zsh shell"
exec "$(command -v zsh)"
else
echo "fallback, default bash"
exec bash
fi