#!/bin/bash

if [ ! "$UID" -eq 0 ] ; then
        echo "The cell modem can only be powered as root or sudo."
        exit -1
fi

GPIO=gpio38

if [ "$#" -eq 0 ] ; then
	echo "Usage:  power-cell-modem [on | off]"
	exit 1
elif [ "$1" == "on" ] ; then
	echo 1 > /sys/class/gpio/$GPIO/value
elif [ "$1" == "off" ] ; then
	echo 0 > /sys/class/gpio/$GPIO/value
fi


exit 0


