#!/bin/sh

BRIGHTNESS_DEFAULT_VALUE=100

# Check args
if [ ${#} -ne 0 ]; then
    echo "Usage: $(basename ${0})"
    exit 1
fi

# Sanity check: Check if integer
brightness=$(fw_printenv -n brightness 2>/dev/null)
if ! [ ! "${brightness}" -ne "${brightness}" ] 2> /dev/null; then
    brightness=${BRIGHTNESS_DEFAULT_VALUE}
	fw_setenv brightness ${brightness}
fi
echo ${brightness}
exit 0
