#!/bin/bash
#
# Raspberry Pi flash LED on successful boot.
#

# Define variables
i=0

# Export pins
if [ ! -e /sys/class/gpio/gpio12 ]; then
        echo "12" > /sys/class/gpio/export
fi

# Set pins as input/output
echo "out" > /sys/class/gpio/gpio12/direction

# Flash LED 4 times
while [ $i -lt 4 ]; do
	echo "1" > /sys/class/gpio/gpio12/value
	sleep 0.5s
	echo "0" > /sys/class/gpio/gpio12/value
    sleep 0.5s
	(( i++ ))
done
