#!/bin/sh #. /etc/init.d/modlibrc case $1 in ""|load) [ ! -d "/tmp/flash/ppp" ] && mkdir -p /tmp/flash/ppp [ ! -d "/mod/etc/ppp" ] && mkdir -p /mod/etc/ppp [ ! -e "/tmp/flash/ppp/chap-secrets" -a ! -e /tmp/flash/ppp/chap-secrets ] && /etc/default.pppd/chap_secrets > /tmp/flash/ppp/chap-secrets #[ ! -e "/tmp/flash/ppp/pap-secrets" -a ! -e /tmp/flash/ppp/pap-secrets ] && /etc/default.pppd/pap_secrets > /tmp/flash/ppp/pap-secrets #[ ! -e "/tmp/flash/ppp/options" -a ! -e /tmp/flash/ppp/options ] && /etc/default.pppd/pppd_options > /tmp/flash/ppp/options [ -e "/tmp/flash/ppp/chap-secrets" -a ! -e /mod/etc/ppp/chap-secrets ] && ln -s /tmp/flash/ppp/chap-secrets /mod/etc/ppp/chap-secrets #[ -e "/tmp/flash/ppp/pap-secrets" -a ! -e /mod/etc/ppp/pap-secrets ] && ln -s /tmp/flash/ppp/pap_secrets /mod/etc/ppp/pap-secrets #[ -e "/tmp/flash/ppp/options" -a ! -e /mod/etc/ppp/options ] && ln -s /tmp/flash/ppp/options /mod/etc/ppp/options modreg file pppd 'chap_secrets' 'chap-secrets' 0 "chap_secrets" modreg daemon --hide pppd #deffile='/mod/etc/default.pppd/pap_secrets.def' #[ -r "/tmp/flash/pap_secrets.def" ] && deffile='/tmp/flash/pap_secrets.def' #modreg file 'pap_secrets' 'pap-secrets' 0 "$deffile" #deffile='/mod/etc/default.pppd/pppd_options.def' #[ -r "/tmp/flash/pppd_options.def" ] && deffile='/tmp/flash/pppd_options.def' #modreg file 'pppd_options' 'options' 0 "$deffile" ;; unload) modunreg file pppd modunreg daemon pppd #modunreg file 'pap_secrets' #modunreg file 'pppd_options' ;; *) echo "pppd is only used by pptp, pptpd and ppp-cgi." 1>&2 echo "Usage: $0 [load|unload]" 1>&2 exit 1 ;; esac exit 0