| 123456789101112131415161718192021222324252627282930313233343536 |
- #!/bin/sh
- HESTIA_CONF_MODULES=$HESTIA/conf/modules
- mkdir -p $HESTIA_CONF_MODULES
- # Returns 1 if module is installed
- hestia_module_isinstalled() {
- osal_kv_read_bool $HESTIA_CONF_MODULES/${1}.conf 'installed'
- }
- # Returns 1 if module is installed and enabled
- hestia_module_isenabled() {
- is_installed=$(osal_kv_read_bool $HESTIA_CONF_MODULES/${1}.conf 'installed')
- is_enabled=$(osal_kv_read_bool $HESTIA_CONF_MODULES/${1}.conf 'enabled')
- if [ "$is_installed" ] && [ "$is_enabled" ]; then
- echo 1
- fi
- }
- hestia_module_getversion() {
- osal_kv_read $HESTIA_CONF_MODULES/${1}.conf 'version'
- }
- hestia_module_getvariant() {
- osal_kv_read $HESTIA_CONF_MODULES/${1}.conf 'variant'
- }
- # Backup config files (usually prior to module install)
- hestia_config_backup() {
- dest=$HESTIA/data/backup/
- filename=${1}-$(date +%Y%m%d%H%M%S)
- shift
- mkdir -p $dest
- tar -zcf ${filename}.tar.gz $@
- }
|