#!/bin/sh G1=18 G2=33 SYS=/sys/class/gpio [ -d $SYS/gpio$G1 ] || echo $G1 > $SYS/export [ -d $SYS/gpio$G2 ] || echo $G2 > $SYS/export echo in > $SYS/gpio$G1/direction echo out > $SYS/gpio$G2/direction echo 1 > $SYS/gpio$G2/value [ "$(cat $SYS/gpio$G1/value)" = "1" ] || echo "1 failed" echo 0 > $SYS/gpio$G2/value [ "$(cat $SYS/gpio$G1/value)" = "0" ] || echo "0 failed" echo $G1 > $SYS/unexport echo $G2 > $SYS/unexport