install.inc 859 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. hestia_module_dummy_install() {
  3. source $HESTIA/bin/module/func.inc
  4. module_installed=$(hestia_module_isinstalled dummy)
  5. if [ "$module_installed" ]; then
  6. echo "Dummy module is already installed. See 'hestia module info dummy'."
  7. exit 1
  8. fi
  9. echo "Installing Dummy module..."
  10. osal_kv_write $HESTIA_CONF_MODULES/dummy.conf 'installed' '1'
  11. osal_kv_write $HESTIA_CONF_MODULES/dummy.conf 'description' 'Hestia Dummy module'
  12. osal_kv_write $HESTIA_CONF_MODULES/dummy.conf 'enabled' '0'
  13. osal_kv_write $HESTIA_CONF_MODULES/dummy.conf 'variant' 'crash-test-dummy'
  14. osal_kv_write $HESTIA_CONF_MODULES/dummy.conf 'version' '4'
  15. exit 0
  16. }
  17. # If this files is _not_ being sourced, act immediately
  18. # (otherise, wait for hestia cli to call the main function)
  19. [[ $_ == $0 ]] && hestia_module_dummy_install $@