Jump to content
Laucien

Using Oh My Zsh in unRAID?

5 posts in this topic Last Reply

Recommended Posts

Hey!, 

 

So, I wanna use zsh+Oh My Zsh in the unRAID shell but I'm having some issues with the setup so that it gets re-installed on every reboot. I enabled zsh using the nerd pack plugin then I can install OMZ manually and it works perfectly but I can't figure out how to make it persist after a reboot. 

 

In summary. I enabled zsh on the nerd pack and added these lines to my go script: 
 

Quote

# Install Oh My ZSH!
chsh -s $(which zsh)
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
cp /boot/extra/scripts/oh-my-zsh/.zshrc /root/

 

The result is that I get zsh as the default shell correctly but the weird thing is that when I SSH into unRAID using PuTTy I don't have Oh My Zsh installed and yet in the command prompt in the actual server (as in, the video output from that computer) I see it installed correctly. 

 

Am I missing anything?. 

Share this post


Link to post

Yes, running from the go file or from user scripts, you will have issues (just like I did). The install script uses home variables, which do not expand properly (instead of ~/ becoming /root, it becomes //).

 

I broke down the installer script, and fixed it for unraid. Here is what I use:

ZSH="/root/.oh-my-zsh"
umask g-w,o-w
git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH
cp "$ZSH"/templates/zshrc.zsh-template /root/.zshrc
sed "/^export ZSH=/ c\\
export ZSH=\"$ZSH\"
" /root/.zshrc > /root/.zshrc-omztemp
mv -f /root/.zshrc-omztemp /root/.zshrc
chsh -s $(which zsh)
env zsh -l

 

Share this post


Link to post

I figured out a simpler way, just define $HOME for scripts:

HOME="/root"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

 

Share this post


Link to post
On 1/1/2019 at 10:25 PM, d2dyno said:

I figured out a simpler way, just define $HOME for scripts:


HOME="/root"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

 

Thought I'd just mention......zsh is in the unraid NerdPack plugin......that is probably the easiest way to install zsh and have it persist through reboots. If you haven't used NerdPack plugin, I'd suggest looking into it. Makes installing various tools and have them persist extremely easy

Edit: Apologies.....you referring to Oh-My-Zsh.....

Edited by Stupifier

Share this post


Link to post
1 minute ago, Stupifier said:

Apologies.....you referring to Oh-My-Zsh

Yep, though nerdpack is what I used to install zsh, as you said 😀 then oh my zsh must be installed on top of that.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.