Version 0.9.1

Datei 'scripts/_get/get_state.sh' Zurück zur Übersicht
#!/bin/ksh
device=${1:?'$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}/set_device.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

json=$(curl -v $userNpassword "${gatewayAPI}devices/${device}")