list.inc 709 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. hestia_module_list() {
  3. source $HESTIA/bin/module/func.inc
  4. printf "%-16s %-12s %-4s %s\n" "Module" "Provides" "Inst" "Description"
  5. for hmd in $HESTIA/data/modules/*.hmd; do
  6. local mod_name=$(osal_kv_read $hmd 'name')
  7. local mod_provides=$(osal_kv_read $hmd 'provides')
  8. local mod_descr=$(osal_kv_read $hmd 'description')
  9. local mod_varinstalled=$(hestia_module_variant_installed $mod_provides)
  10. if [ "$mod_varinstalled" == "$mod_name" ]; then
  11. local mod_installed='Yes'
  12. else
  13. local mod_installed='No'
  14. fi
  15. printf "%-16s %-12s %-4s %s\n" "$mod_name" "$mod_provides" "$mod_installed" "$mod_descr"
  16. done
  17. }