#!/bin/bash

if [ ! -L /sys/class/gpio/gpio72 ];then
        echo -e "gpio72 used for system led.\n"
        echo 72 > /sys/class/gpio/export
        echo out > /sys/class/gpio/gpio72/direction
        echo 0 > /sys/class/gpio/gpio72/value
fi

if [ ! -L /sys/class/gpio/gpio73 ];then
        echo -e "GPIO73 used for Reset button\n"
        echo 73 > /sys/class/gpio/export
        echo in > /sys/class/gpio/gpio73/direction
        echo both > /sys/class/gpio/gpio73/edge
fi

if [ ! -L /sys/class/gpio/gpio111 ];then
        echo -e "GPIO111 used for input detect\n"
        echo 111 > /sys/class/gpio/export
        echo in > /sys/class/gpio/gpio111/direction
        echo both > /sys/class/gpio/gpio111/edge
fi

if [ ! -L /sys/class/gpio/gpio112 ];then
        echo -e "GPIO112 used for Relay Control.\n"
        echo 112 > /sys/class/gpio/export
        echo out > /sys/class/gpio/gpio112/direction
        echo 0 > /sys/class/gpio/gpio112/value
fi

