#!/bin/sh
usage () {
echo “Usage pump <1|2|0> <sec>”
exit 1
}
if [ ! $# = 2 ] ; then
usage
fi

#3 = pin1 di SW1
gpioctl dirout 3
#4 = pin 2 di SW1
gpioctl dirout 4
#1 = pin 5 di SW1
# gpioctl dirout 1
# 3,4, triac, rele’,
case $1 in
“1” ) port=3;;
“2” ) port=4;;
“0” ) port=99;;
* ) usage;;
esac

#gpioctl set ${port}
#sleep $2
#$gpioctl clear ${port}
#

bit=1
let “pausa=$2 * 4”
echo $pausa
if grep “^`date +%d/%m/%y`$” /etc/nopump ; then
bit=0
echo “no-pump day”
else
gpioctl set ${port}
sleep ${pausa}
gpioctl clear ${port}

fi

#end

Annunci