postinst 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. set -e
  3. if [ "$1" != "configure" ]; then
  4. exit 0
  5. fi
  6. # Run triggers below only on updates
  7. if [ ! -e "/usr/local/hestia/data/users/" ]; then
  8. exit
  9. fi
  10. # Check if preinstall hook exists
  11. if [ -e "/etc/hestiacp/hooks/php/pre_install.sh" ]; then
  12. /etc/hestiacp/hooks/php/pre_install.sh
  13. fi
  14. ###############################################################
  15. # Initialize functions/variables #
  16. ###############################################################
  17. if [ -z "$HESTIA" ]; then
  18. export HESTIA='/usr/local/hestia'
  19. PATH=$PATH:/usr/local/hestia/bin
  20. export PATH
  21. fi
  22. # Load upgrade functions and variables
  23. source /usr/local/hestia/func/main.sh
  24. source /usr/local/hestia/func/upgrade.sh
  25. source /usr/local/hestia/conf/hestia.conf
  26. source /usr/local/hestia/install/upgrade/upgrade.conf
  27. # Restart hestia service
  28. if [ -f "/etc/init.d/hestia" ]; then
  29. systemctl restart hestia > /dev/null 2>&1
  30. fi
  31. # Check if preinstall hook exists
  32. if [ -e "/etc/hestiacp/hooks/php/post_install.sh" ]; then
  33. /etc/hestiacp/hooks/php/post_install.sh
  34. fi