remove.inc 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. hestia_module_php_remove() {
  3. source $HESTIA/bin/module/func.inc
  4. source $HESTIA/bin/module/php/func.inc
  5. module_installed=$(hestia_module_isinstalled php)
  6. if [ ! "$module_installed" ] && [ ! "$param_force" ]; then
  7. echo "PHP module is not installed. See 'hestia module info php'."
  8. exit 1
  9. fi
  10. module_variant=$(hestia_module_getvariant php)
  11. if [ "$module_variant" != 'php-fpm' ] && [ ! "$param_force" ]; then
  12. echo "The installed PHP module is not FPM. See 'hestia module info php'."
  13. exit 1
  14. fi
  15. echo "Removing PHP (FPM) module..."
  16. # TODO: Remove all added versions
  17. osal_kv_write $HESTIA/conf/hestia.conf 'WEB_BACKEND' 'no'
  18. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'installed' '0'
  19. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'description' ''
  20. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'enabled' '0'
  21. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'variant' ''
  22. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'version' '0'
  23. exit 0
  24. }