Add zsh install script

This commit is contained in:
aloslider
2026-04-02 04:29:30 +03:00
parent d93b1edf61
commit 632a0607c8
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
ZSH_PATH="$(which zsh)"
if !(grep -q "^$ZSH_PATH$" /etc/shells;) then
echo "$ZSH_PATH" | sudo tee -a /etc/shells > /dev/null
echo "Added $ZSH_PATH to /etc/shells"
fi
if [[ "$(getent passwd $USER | cut -d: -f7)" != "$ZSH_PATH" ]]; then
chsh -s "$ZSH_PATH"
echo "Set ZSH as default, log out and log back in (or reboot) for the change to take effect"
else
echo "Default shell is already ZSH"
fi