remove.inc 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. hestia_module_php_remove() {
  3. source $HESTIA/bin/module/func.inc
  4. source $HESTIA/bin/module/php/func.inc
  5. if ! hestia_module_isinstalled 'php' && [ ! "$param_force" ]; then
  6. echo "PHP module is not installed. See 'hestia module info php'."
  7. return 0
  8. fi
  9. echo "Removing PHP module..."
  10. # Remove all added versions
  11. # FIXME: this will not remove unsupported but installed PHP versions
  12. # (i.e. supported by an older version of Hestia)
  13. for php_version in $PHP_SUPPORTED_VERSIONS; do
  14. php_withoutdot=${php_version//.}
  15. php_version_present=$(osal_kv_read $HESTIA_CONF_MODULES/php.conf "php${php_withoutdot}_present" '')
  16. if [ "$php_version_present" ]; then
  17. hestia module php del $php_version
  18. fi
  19. done
  20. osal_kv_write $HESTIA/conf/hestia.conf 'WEB_BACKEND' 'no'
  21. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'installed' '0'
  22. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'description' ''
  23. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'enabled' '0'
  24. osal_kv_write $HESTIA_CONF_MODULES/php.conf 'version' '0'
  25. return 0
  26. }