gsm_off()
{
	# turn VBAT off
	echo 1 > /sys/class/gpio/gpio$1/value
	# release PWR_KEY
	echo 0 > /sys/class/gpio/gpio$2/value
}

# args:
# 1 - GPIO num of PWR_GSM (VBAT)
# 2 - GPIO num of ON_GSM (PWR_KEY)
gsm_on()
{
	# turn VBAT on
	echo 0 > /sys/class/gpio/gpio$1/value
	sleep 1
	# trigger power by PWRKEY
	echo 1 > /sys/class/gpio/gpio$2/value
	sleep 1
	echo 0 > /sys/class/gpio/gpio$2/value
}
	_on=66
	_pwr=70
	_status=72
	
# activate GPIO interface
		echo $_status > /sys/class/gpio/export
		echo $_on > /sys/class/gpio/export
		echo $_pwr > /sys/class/gpio/export

		# set lines' mode and initial state
		echo "out" > /sys/class/gpio/gpio$_pwr/direction
		echo "out" > /sys/class/gpio/gpio$_on/direction
		echo "in" > /sys/class/gpio/gpio$_status/direction
		gsm_off $_pwr $_on
		sleep 1
		gsm_on $_pwr $_on
		sleep 1
		#echo "INIT GSM STATUS="`cat /sys/class/gpio/gpio$_status/value`