remove.inc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. hestia_module_vsftpd_remove() {
  3. source $HESTIA/bin/module/func.inc
  4. module_installed=$(hestia_module_isinstalled ftp)
  5. if [ ! "$module_installed" ] && [ ! "$param_force" ]; then
  6. echo "FTP module is not installed. See 'hestia module info ftp'."
  7. exit 1
  8. fi
  9. module_variant=$(hestia_module_getvariant ftp)
  10. if [ "$module_variant" != 'vsftpd' ] && [ ! "$param_force" ]; then
  11. echo "The installed FTP module is not vsftpd. See 'hestia module info ftp'."
  12. exit 1
  13. fi
  14. echo "Removing FTP (vsftpd) module..."
  15. osal_service_stop vsftpd
  16. osal_service_disable vsftpd
  17. hestia_config_backup 'vsftpd-remove' $OSAL_PATH_VSFTPD_CONF
  18. osal_package_remove vsftpd
  19. rm -rf $OSAL_PATH_VSFTPD_CONF
  20. osal_kv_write $HESTIA/conf/hestia.conf 'FTP_SYSTEM' 'no'
  21. osal_kv_write $HESTIA_CONF_MODULES/ftp.conf 'installed' '0'
  22. osal_kv_write $HESTIA_CONF_MODULES/ftp.conf 'description' ''
  23. osal_kv_write $HESTIA_CONF_MODULES/ftp.conf 'enabled' '0'
  24. osal_kv_write $HESTIA_CONF_MODULES/ftp.conf 'variant' ''
  25. osal_kv_write $HESTIA_CONF_MODULES/ftp.conf 'version' '0'
  26. exit 0
  27. }