#!/bin/sh -e
#
#   /etc/init.d/neostrada: start or stop Neostrada network connection.

[ -x /usr/sbin/pppd ] || exit 0
. /lib/lsb/init-functions

case "$1" in
start)
    log_begin_msg "Starting up Neostrada..."
    modprobe ppp_generic
    modprobe pppoatm
    pppd call neostrada
    log_end_msg $?
    ;;
stop)
    log_begin_msg "Shutting down Neostrada..."
    poff neostrada
    log_end_msg $?
    ;;
restart|force-reload)
    log_begin_msg "Restarting Neostrada..."
    poff neostrada || true
    sleep 5
    pppd call neostrada
    log_end_msg $?
    ;;
*)
    log_success_msg "Usage: /etc/init.d/neostrada {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

exit 0
