#!/bin/bash
# shellcheck disable=SC1091 # Skip sourced checks.
#200829 (v2.0) Resolve shellcheck warnings.

export TEXTDOMAIN=frisbee
export OUTPUT_CHARSET=UTF-8
. gettext.sh

PPPD_PID=$(cat /var/run/ppp-gprs.pid)
if [ -n "$PPPD_PID" ];then
	CONNECTED_DEVICE="$(pgrep -ax 'pppd' | grep -w "^$PPPD_PID" | grep -o '/dev/[a-z][^ ]*')" #200829
	if [ -n "$CONNECTED_DEVICE" ];then
	    kill "$PPPD_PID"
	    sleep 0.1 #200829
	    rm -f /var/run/ppp-gprs.pid
	    gtkdialog-splash -timeout 15 -placement center -bg orange -text "$(eval_gettext "Mobile device \$CONNECTED_DEVICE disconnected")"
	fi
fi
exit 0
