diff --git a/install_ohmyzsh_deb.sh b/install_ohmyzsh_deb.sh index 58f4ab7..5cb23b4 100644 --- a/install_ohmyzsh_deb.sh +++ b/install_ohmyzsh_deb.sh @@ -20,7 +20,7 @@ else exit 1 fi # 复制配置文件到根目录 -cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc +cp ~/.oh-my-zsh/templates/zshrc.zsh-template .zshrc if [ $? -eq 0 ];then echo "复制配置文件成功" else diff --git a/install_ohmyzsh_rhel.sh b/install_ohmyzsh_rhel.sh index 117f536..58a60f8 100644 --- a/install_ohmyzsh_rhel.sh +++ b/install_ohmyzsh_rhel.sh @@ -14,9 +14,21 @@ if [ ! -d "~/.oh-my-zsh" ]; then git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh fi # 备份 -sudo cp .zshrc .zshrc.bak +cp .zshrc .zshrc.bak +if [ $? -eq 0 ];then + echo "备份.zshrc成功" +else + echo "备份.zshrc失败" + exit 1 +fi # 复制配置文件到根目录 -sudo cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc +cp ~/.oh-my-zsh/templates/zshrc.zsh-template .zshrc +if [ $? -eq 0 ];then + echo "复制配置文件成功" +else + echo "复制配置文件失败" + exit 1 +fi # 修改全局配置,对所有的用户生效 echo "/root/.zshrc" >> /etc/zshrc # 更改新用户的默认shell @@ -63,8 +75,13 @@ echo "成功克隆所有插件!" # 切换到根目录 cd ~/ # 配置.zshrc文件 -sudo cp .zshrc .zshrc.back - +cp .zshrc .zshrc.back +if [ $? -eq 0 ];then + echo "备份.zshrc成功" +else + echo "备份.zshrc失败" + exit 1 +fi # 安装完成 echo "Zsh, Oh My Zsh, Powerlevel10k, zsh-autosuggestions, zsh-syntax-highlighting, and zsh-completions have been installed and configured."