我正在尝试一些虚拟化技术,因此我一直在使用vagrant来提供一个centos7虚拟机,并且现在正在配置应用程序。
我的vagrant配置运行一个bootstrap.sh文件,它是一个bash脚本,在其中我安装了zsh,然后我想按照https://github.com/sorin-ionescu/prezto的步骤进行配置。 第一步是启动zsh然后运行一些命令。
目前这是我所拥有的代码。
我希望在我通过ssh连接到虚拟机时,它能成为默认的shell。然而看起来它并没有生效,因为在运行"vagrant up"步骤时没有出现任何错误,所以我想知道这是否可能,并且这样做是否正确? 感谢您!
我的vagrant配置运行一个bootstrap.sh文件,它是一个bash脚本,在其中我安装了zsh,然后我想按照https://github.com/sorin-ionescu/prezto的步骤进行配置。 第一步是启动zsh然后运行一些命令。
目前这是我所拥有的代码。
echo "Installing zsh"
yum install -y zsh
echo "Configure zsh"
# touch /home/vagrant/.zshrc
exec /usr/bin/zsh
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
chsh -s /bin/zsh
我希望在我通过ssh连接到虚拟机时,它能成为默认的shell。然而看起来它并没有生效,因为在运行"vagrant up"步骤时没有出现任何错误,所以我想知道这是否可能,并且这样做是否正确? 感谢您!
yum install -y zsh
echo "Configure zsh"
sudo -u vagrant zsh <<'EOF'
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
EOF chsh -s /bin/zsh vagrant` - mcbain83