feat: dont call chsh in containers

This commit is contained in:
Daniel Bauer
2026-08-15 11:19:36 +02:00
parent a5fd7ad3fb
commit 308ef87e04

View File

@@ -7,8 +7,12 @@ if ! type zsh > /dev/null; then
else
# Make ZSH the default shell environment
if [ $(cat /etc/passwd | grep $USER | awk -F ':' '{print substr($7, length($7)-3)}') != "/zsh" ]; then
{{- if .ephemeral }}
echo "Ephemeral machine: leaving default shell as-is."
{{- else }}
echo "Changing shell to zsh."
chsh -s $(which zsh) || echo "chsh failed, leaving default shell as-is." >&2
{{- end }}
else
echo "Shell is already zsh."
fi