# $Id: ltsp_functions 2108 2006-08-29 02:54:27Z francis $
function get_cfg(){
    #
    # Usage:  get_cfg PARM [DEFAULT]
    #
    VALUE=`/bin/getltscfg $1`
    if [ "$#" -gt 1 -a -z "${VALUE}" ]; then
        echo $2
    else
        echo ${VALUE}
    fi
}

function pr_warn(){
    if [ -w /proc/progress ]; then
        echo w >/proc/progress
    fi
}

function pr_fail(){
    if [ -w /proc/progress ]; then
        echo f >/proc/progress
    fi
}

function pr_set(){
    SPLASHY=/sbin/splashy_update
    if [ -x $SPLASHY ]; then
        $SPLASHY "progress $1" &> /dev/null
    fi
    echo `date` "progress=$1 step=$2" >> /tmp/boot.log
}

function reg_info(){
    # store the variable value in a file with the variable's name
    # Ex : 
    # KEY='value'
    # reg_info KEY 
    # /tmp/info/KEY will contain the string "value"
    VAR=$1
    echo ${!VAR} >/tmp/info/${VAR}
}
