list.inc 703 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. hestia_module_list() {
  3. source $HESTIA/bin/module/func.inc
  4. for conf_file in $HESTIA_CONF_MODULES/*.conf; do
  5. mod_name=$(basename $conf_file .conf)
  6. mod_descr=$(osal_kv_read ${conf_file} 'description')
  7. module_installed=$(hestia_module_isinstalled $mod_name)
  8. module_enabled=$(hestia_module_isenabled $mod_name)
  9. if [ "$module_installed" ]; then
  10. if [ "$module_enabled" ] || [ "$param_all" ]; then
  11. echo "$mod_name: $mod_descr"
  12. fi
  13. fi
  14. done
  15. }
  16. # If this files is _not_ being sourced, act immediately
  17. # (otherise, wait for hestia cli to call the main function)
  18. [[ $_ == $0 ]] && hestia_module_list $@