Просмотр исходного кода

Add zsh support for Hestia PATH configuration (#5191)

Add support for zsh shell in PATH configuration during installation.
Now checks for both .bashrc and .zshrc files and adds Hestia bin directory
to PATH for whichever shell configuration files exist.
sahsanu 2 месяцев назад
Родитель
Сommit
b3cc45e280
2 измененных файлов с 14 добавлено и 4 удалено
  1. 7 2
      install/hst-install-debian.sh
  2. 7 2
      install/hst-install-ubuntu.sh

+ 7 - 2
install/hst-install-debian.sh

@@ -2406,11 +2406,16 @@ BIN="$HESTIA/bin"
 source $HESTIA/func/syshealth.sh
 syshealth_repair_system_config
 
-# Add /usr/local/hestia/bin/ to path variable
-echo 'if [ "${PATH#*/usr/local/hestia/bin*}" = "$PATH" ]; then
+# Add /usr/local/hestia/bin/ to PATH variable in .bashrc if it exists
+[[ -f /root/.bashrc ]] && echo 'if [ "${PATH#*/usr/local/hestia/bin*}" = "$PATH" ]; then
     . /etc/profile.d/hestia.sh
 fi' >> /root/.bashrc
 
+# Add /usr/local/hestia/bin/ to PATH variable in .zshrc if it exists
+[[ -f /root/.zshrc ]] && echo 'if [ "${PATH#*/usr/local/hestia/bin*}" = "$PATH" ]; then
+    . /etc/profile.d/hestia.sh
+fi' >> /root/.zshrc
+
 #----------------------------------------------------------#
 #                   Hestia Access Info                     #
 #----------------------------------------------------------#

+ 7 - 2
install/hst-install-ubuntu.sh

@@ -2397,11 +2397,16 @@ BIN="$HESTIA/bin"
 source $HESTIA/func/syshealth.sh
 syshealth_repair_system_config
 
-# Add /usr/local/hestia/bin/ to path variable
-echo 'if [ "${PATH#*/usr/local/hestia/bin*}" = "$PATH" ]; then
+# Add /usr/local/hestia/bin/ to PATH variable in .bashrc if it exists
+[[ -f /root/.bashrc ]] && echo 'if [ "${PATH#*/usr/local/hestia/bin*}" = "$PATH" ]; then
     . /etc/profile.d/hestia.sh
 fi' >> /root/.bashrc
 
+# Add /usr/local/hestia/bin/ to PATH variable in .zshrc if it exists
+[[ -f /root/.zshrc ]] && echo 'if [ "${PATH#*/usr/local/hestia/bin*}" = "$PATH" ]; then
+    . /etc/profile.d/hestia.sh
+fi' >> /root/.zshrc
+
 #----------------------------------------------------------#
 #                   Hestia Access Info                     #
 #----------------------------------------------------------#