summaryrefslogtreecommitdiffstats
path: root/src/ppp.subr
blob: c05ebd70c131b423988f5dc9f7e21d2d01ef6333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/bash
ppp_up() {
    [ -z "$PEER" ] && PEER="/etc/ppp/peers/provider"
    [ -z "$PPP_TIMEOUT" ] && PPP_TIMEOUT=30

    /usr/sbin/pppd call $PEER updetach child-timeout $PPP_TIMEOUT linkname $(basename $PEER)

    if [ $? -ne 0 ]; then
       err "pppd connection failed"
       exit 1
    fi
}

ppp_down() {
    kill $(cat /var/run/ppp-$(basename $PEER))
}

ppp_clean_scope() {
    unset PPP_PEER PPP_TIMEOUT    
}
# vim: set ts=4 et sw=4: