Version 0.9.1

Datei 'scripts/_get/turn_off.sh' Zurück zur Übersicht
#!/bin/ksh

device=${1:?"No Device!"}

#get base dir
BASEDIR=$(dirname "$0")
if [ -L $0 ] ; then
    BASEDIR=$(dirname $(readlink -f "$0"))
fi

#config
if [ -e "$BASEDIR/../config.conf" ]; then
	. "$BASEDIR/../config.conf"
else
	echo "No config found at: $BASEDIR/../config.conf"
fi

function wLog {
	log="${logdir}/turn_off.log"
	date=$(date "+%Y-%m-%d_%H:%M:%S.%N")
	
	echo "$date $USER $1 $2 $3 $4 $5 $6 $7 $8 $9" >> "$log"
}

. $shdir/synonyms $device

if [ -z "$device" ]; then
	echo "Unknown device $1 $2 $3 $4 $5 $6 $7 $8 $9 $10"
	wLog "unknown_device" $1 $2 $3 $4 $5 $6 $7 $8 $9 $10
	exit 1
fi

"$shdir/_get/set_device.sh" "$device" "$valueOff"