#!/bin/bash

HOST=192.168.1.1
STACKID=05

IOPORTS=$1
IOSTATUS=$2

if [ "$2" = "on" ] ; then IOSTATUS=01 ; fi
if [ "$2" = "off" ] ; then IOSTATUS=00 ; fi

echo -n -e "\x$STACKID\x03\x07\x00\x$IOPORTS\x6F\x$IOSTATUS" | nc -q0 $HOST 4223

echo Bits $IOPORTS gesetzt auf $IOSTATUS/$2

