Browse Source

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 months ago
parent
commit
b3cc45e280
2 changed files with 14 additions and 4 deletions
  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
 source $HESTIA/func/syshealth.sh
 syshealth_repair_system_config
 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
     . /etc/profile.d/hestia.sh
 fi' >> /root/.bashrc
 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                     #
 #                   Hestia Access Info                     #
 #----------------------------------------------------------#
 #----------------------------------------------------------#

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

@@ -2397,11 +2397,16 @@ BIN="$HESTIA/bin"
 source $HESTIA/func/syshealth.sh
 source $HESTIA/func/syshealth.sh
 syshealth_repair_system_config
 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
     . /etc/profile.d/hestia.sh
 fi' >> /root/.bashrc
 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                     #
 #                   Hestia Access Info                     #
 #----------------------------------------------------------#
 #----------------------------------------------------------#