#!/bin/sh
#File: /usr/sbin/ppp-off
#Purpose: a simple PPP dial-up script
#
#
# Determine device
if [ -z "$1" ]; then
        DEVICE=ppp0
        else
        DEVICE=$1
fi
#
# Stop program
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid` 
#
# Delete lock file
        if [ ! "$?"="0" ]; then
                rm -f /var/run/$DEVICE.pid
                echo "ERROR: Removed stale pid file"
                exit 1
        fi
#
# Getting out
        echo "PPP link to $DEVICE terminated."
        
        echo "3G light state..."
                led -l1 -g0
        exit 0
fi
#
# Not ruuning
echo "ERROR: PPP link is not active on $DEVICE."


exit 1
