Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # /etc/init.d/ppp: start or stop PPP link. |
| 4 | # |
| 5 | # If you want PPP started on boot time (most dialup systems won't need it) |
| 6 | # rename the /etc/ppp/no_ppp_on_boot file to /etc/ppp/ppp_on_boot, and |
| 7 | # follow the instructions in the comments in that file. |
| 8 | |
| 9 | # Source function library. |
| 10 | . /etc/init.d/functions |
| 11 | |
| 12 | test -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot || exit 0 |
| 13 | if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi |
| 14 | |
| 15 | case "$1" in |
| 16 | start) |
| 17 | echo -n "Starting up PPP link: pppd" |
| 18 | if [ "$RUNFILE" = "1" ]; then |
| 19 | /etc/ppp/ppp_on_boot |
| 20 | else |
| 21 | pppd call provider |
| 22 | fi |
| 23 | echo "." |
| 24 | ;; |
| 25 | stop) |
| 26 | echo -n "Shutting down PPP link: pppd" |
| 27 | if [ "$RUNFILE" = "1" ]; then |
| 28 | poff |
| 29 | else |
| 30 | poff provider |
| 31 | fi |
| 32 | echo "." |
| 33 | ;; |
| 34 | status) |
| 35 | status /usr/sbin/pppd; |
| 36 | exit $? |
| 37 | ;; |
| 38 | restart|force-reload) |
| 39 | echo -n "Restarting PPP link: pppd" |
| 40 | if [ "$RUNFILE" = "1" ]; then |
| 41 | poff |
| 42 | sleep 5 |
| 43 | /etc/ppp/ppp_on_boot |
| 44 | else |
| 45 | poff provider |
| 46 | sleep 5 |
| 47 | pppd call provider |
| 48 | fi |
| 49 | echo "." |
| 50 | ;; |
| 51 | *) |
| 52 | echo "Usage: /etc/init.d/ppp {start|stop|status|restart|force-reload}" |
| 53 | exit 1 |
| 54 | ;; |
| 55 | esac |
| 56 | |
| 57 | exit 0 |