#!/bin/sh #------------------------------------------------------------------------------ # /etc/rc.d/rc340.circuits - setup circuits # was file /etc/rc.d/circuits # # Creation: 17.11.2000 fm # Last Update: $Id: rc340.circuits 18684 2010-09-30 14:29:29Z jw5 $ #------------------------------------------------------------------------------ begin_script CIRCUITS "preparing circuits ..." # add_imond_entry expects dev name phone bandwidth hup_timeout route times chargeint type add_imond_entry () { case $route in 0.0.0.0/0) droute='y' ;; *) droute='n' ;; esac if [ -z "$times" -o -z "$dev" -o -z "$bandwidth" -o -z "$hup_timeout" -o -z "$route" -o -z "$phone" -o -z "$name" -o -z "$charge" -o -z "$chargeint" ] then log_error "empty variable in add_imond_entry" fi if [ "$IMOND_USE_ORIG" != yes -a "$dev" = pppoe ]; then dev=ppp0 fi echo "$name $type $dev $droute $hup_timeout $charge $chargeint $phone $bandwidth $times" >>/etc/imond.conf } if [ ! -f /etc/ppp/pap-secrets ] # already existing? then # yes, don't overwrite echo "writing /etc/ppp/pap-secrets ..." { echo "#----------------------------------------------------------------------------" echo "# /etc/ppp/pap-secrets - secrets for authentication using PAP" echo "# automatically created by rc340.circuits" echo "#" echo "# client server secret IP addresses" echo "#----------------------------------------------------------------------------" } >/etc/ppp/pap-secrets chmod 600 /etc/ppp/pap-secrets fi if [ ! -f /etc/ppp/chap-secrets ] # already existing? then # yes, don't overwrite ln -s /etc/ppp/pap-secrets /etc/ppp/chap-secrets fi >/etc/imond.conf # write imond configuration mkdir -p /etc/ppp/peers end_script