Install Requirements Packages
opkg update && opkg install ca-certificates zsh curl git-http
Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Set zsh as default (thanks to @mlouielu)
which zsh && sed -i -- 's:/bin/ash:'`which zsh`':g' /etc/passwd
To prevent lock-outs after accidentially removing zsh(as explained in the wiki) you can add a check for zsh
and fallback to ash
in /etc/rc.local
(thanks to @fox34):
# Revert root shell to ash if zsh is not available
if grep -q '^root:.*:/usr/bin/zsh$' /etc/passwd && [ ! -x /usr/bin/zsh ]; then
# zsh is root shell, but zsh was not found or not executable: revert to default ash
[ -x /usr/bin/logger ] && /usr/bin/logger -s "Reverting root shell to ash, as zsh was not found on the system"
sed -i -- 's:/usr/bin/zsh:/bin/ash:g' /etc/passwd
fi
Just in case you are locked out by the wrong ZSH path and need a way to execute commands: try
Network > Firewall > Custom Rules
. These commands get executed right away.