Browse Source

Add hooks before and after update

Jaap Marcus 4 years ago
parent
commit
847650d2ae
2 changed files with 10 additions and 0 deletions
  1. 5 0
      src/deb/hestia/postinst
  2. 5 0
      src/deb/hestia/preinst

+ 5 - 0
src/deb/hestia/postinst

@@ -92,4 +92,9 @@ upgrade_send_notification_to_panel
 upgrade_send_notification_to_email
 upgrade_send_log_to_email
 
+if [ -e "/etc/hestiacp/hooks/post_install.sh" ]; then
+    echo "[ * ] Execute post install hook"
+    /etc/hestiacp/hooks/post_install.sh
+fi
+
 exit 0

+ 5 - 0
src/deb/hestia/preinst

@@ -18,4 +18,9 @@ HESTIA_V=$(dpkg -s hestia | grep -i version | awk '{ print $2 }')
 
 if [ ! "$HESTIA_V" = "$VERSION" ]; then
     sed -i "s/VERSION=.*/VERSION='$HESTIA_V'/g" /usr/local/hestia/conf/hestia.conf
+fi
+
+if [ -e "/etc/hestiacp/hooks/pre_install.sh" ]; then
+    echo "[ * ] Execute pre install hook"
+    /etc/hestiacp/hooks/pre_install.sh
 fi