70 lines
1.2 KiB
Bash
70 lines
1.2 KiB
Bash
#!/bin/sh
|
|
#
|
|
# pppoatm - Initscript for starting a PPP over ATM connection
|
|
# description: PPP over ATM start/stop script
|
|
# chkconfig: 345 80 10
|
|
|
|
# Source function library
|
|
[ -r /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions
|
|
|
|
PPPD="/usr/sbin/pppd"
|
|
PPPDCONF_OATM="/etc/ppp/options-atm"
|
|
PLUGIN="/usr/lib/pppd/@PPPDVERSION@/pppoatm.so"
|
|
|
|
RETVAL=0
|
|
|
|
start() {
|
|
echo -n "Starting ppp over ATM..."
|
|
$PPPD file $PPPDCONF_OATM >/dev/null
|
|
evaluate_retval
|
|
}
|
|
|
|
stop() {
|
|
echo -n "Stopping ppp daemon..."
|
|
killproc $PPPD >/dev/null 2>&1
|
|
rm -f /var/run/ppp*.pid
|
|
}
|
|
|
|
status() {
|
|
pidf=$(cd /var/run && ls --sort=time ppp*.pid 2>/dev/null)
|
|
pppint=${pidf/.pid*/}
|
|
|
|
LANG=C /sbin/ifconfig $pppint 2>/dev/null | \
|
|
grep -q "UP POINTOPOINT RUNNING" && {
|
|
echo -n "ppp connection active: $pppint"
|
|
return 0; }
|
|
|
|
echo -n "No ppp connections"
|
|
return 1
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
|
|
stop)
|
|
stop
|
|
;;
|
|
|
|
status)
|
|
status
|
|
;;
|
|
|
|
restart)
|
|
stop
|
|
start
|
|
;;
|
|
|
|
*)
|
|
echo $"Usage: $0 {start|stop|status|restart}"
|
|
exit 1
|
|
esac
|
|
|
|
RETVAL=$?
|
|
|
|
[ $RETVAL = 0 ] && echo_success || echo_failure
|
|
echo
|
|
|
|
exit $RETVAL
|