#!/bin/sh set -e ipaddress=192.168.20.71 if [ $# -lt 1 ]; then echo "dimplex-set " exit 1 fi value=$1 if [ $value -gt 38 ]; then echo "New value too high" exit 1 fi if [ $value -lt 1 ]; then echo "New value too low" exit 1 fi echo Setting dimplex level to $value curl -sS "$ipaddress/usr-cgi/query.cgi?var|I|1|$value"\ | sed 's#<[^>]*>##g'\ | grep -v '^$'