MODEM_POWER_ON_GPIO=/sys/class/gpio/gpio19/value

modem_power_on() {
	if [ -f "$MODEM_POWER_ON_GPIO" ]; then
		echo 0 > $MODEM_POWER_ON_GPIO
		sleep 1
		echo 1 > $MODEM_POWER_ON_GPIO
		sleep 1
	fi
}

case $1 in
"mts" | "beeline")
	modem_power_on
	/usr/sbin/pppd \
		user $1 \
		connect "/usr/sbin/chat -v -f /etc/ppp/$1/gprs-connect" \
		file /etc/ppp/options
	;;
*)
	echo "Usage: $0 beeline|mts"
	exit 1
	;;
esac

