Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install oh-my-zsh on openwrt/lede-project
opkg update && opkg install ca-certificates zsh curl git-http
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 
sed -i -- 's:/bin/ash:/usr/bin/zsh:g' /etc/passwd


# -- reboot, all done. 
@mlouielu

This comment has been minimized.

mlouielu commented Jan 2, 2018

Awesome, thanks!

step 4 edit can changed to use this:
sed -i -- 's/ash/zsh/g' /etc/passwd

@fire1ce

This comment has been minimized.

Owner

fire1ce commented Feb 20, 2018

Thanks for the star and suggestions. I don't have a OpenWrt/Lede to make sure its works.

@jqqqqqqqqqq

This comment has been minimized.

jqqqqqqqqqq commented Mar 4, 2018

On my 17.01.4,ca-bundle should be installed, otherwise curl reports:
curl: (77) Error reading ca cert file /etc/ssl/certs/ca-certificates.crt - mbedTLS: (-0x3E00) PK - Read/write of file failed

@fire1ce

This comment has been minimized.

Owner

fire1ce commented Mar 17, 2018

updated the gist to include "ca-bundle" installation

@mlouielu

This comment has been minimized.

mlouielu commented Mar 26, 2018

Hi @fire1ce, this line should change to use this:

sed -i -- 's/ash/zsh/g' /etc/passwd

to

sed -i -- 's:/bin/ash:/usr/bin/zsh:g' /etc/passwd

Otherwise it will reject user to login from ssh

@fire1ce

This comment has been minimized.

Owner

fire1ce commented Mar 26, 2018

@mlouielu thanks. change been applied to the gist.

@moorer2k

This comment has been minimized.

moorer2k commented Sep 12, 2018

Great script, I had to modify the sed command to work for my Pineapple Tetra, which runs off OpenWRT also.

Changed:

sed -i -- 's:/bin/ash:/usr/bin/zsh:g' /etc/passwd

to

sed -i -- 's:/bin/ash:/bin/zsh:g' /etc/passwd

Adding the /usr/ segment would prevent logging in at all.

But, thanks for the provided script! Saved so much time!

@mlouielu

This comment has been minimized.

mlouielu commented Sep 16, 2018

maybe it should use which zsh to determine the path, like this:

$ which zsh && sed -i -- 's:/bin/ash:'`which zsh`':g' /etc/passwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment