remove.inc 1.1 KB

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