Skip to content

YAHM Module: template

Leonid Kogan edited this page May 12, 2016 · 2 revisions

Dies ist ein Dummy Modul als Beispiel für weitere Module

die Variable description muss vorhanden sein und wird von YAHM ausgewertet, die Methoden _module_install und _module_remove werden durch YAHM bei der Installation bzw. der Deinstallation des Moduls aufgerufen. Innerhalb des Moduls stehen diverse Variablen zur Verfügung, diese sind in dem unten angegebenen Beispiel zu finden

#!/bin/bash
#
# Template for new Modules
# 

description="Just a template for new module"

_module_install()
{
    echo        "Container Name is: ${LXCNAME}"
    echo        "Module Name is: ${MODULE}"
    echo        "Container ROOT is: ${LXC_ROOT}"
    echo        "Container ROOT_FS is: ${LXC_ROOT_FS}"

    if [ $IS_FORCE -eq 1 ]
    then
        info "Entering force mode"
    fi

    if [ $IS_VERBOSE -eq 1 ]
    then
        info "Verbose is selected, QUIET=${QUIET} VERBOSE=${VERBOSE}"
    fi
    
    info        "template info message"
    progress    "template progress message"
    die         "template exit"
}

_module_remove()
{
    echo "template remove"
}