#!/bin/bash
gpio=/sys/devices/platform/mts-io/reset
#gpio=/tmp/pb
status="0"
while :
do
usleep 150000
if [[ -r "$gpio" ]]; then
read -n 1 val < $gpio
if [[ ! -z "$val" && "$val" != "$status" ]]; then
if [[ "$val" == "1" ]]; then
mtre-leds start-test
status=$val
elif [[ "$val" == "0" ]]; then
mtre-leds stop-test
status=$val
fi
fi
fi
done