|
rpm-build |
133ac4 |
#! /bin/bash
|
|
rpm-build |
133ac4 |
#
|
|
rpm-build |
133ac4 |
# ifup-ippp
|
|
rpm-build |
133ac4 |
#
|
|
rpm-build |
133ac4 |
# This script is normally called from the ifup script when it detects an ippp device.
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
. /etc/init.d/functions
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
cd /etc/sysconfig/network-scripts
|
|
rpm-build |
133ac4 |
. ./network-functions
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Get global network configuration
|
|
rpm-build |
133ac4 |
[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
GATEWAY=""
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set device
|
|
rpm-build |
133ac4 |
CONFIG=$1
|
|
rpm-build |
133ac4 |
[ -f "${CONFIG}" ] || CONFIG=ifcfg-${1}
|
|
rpm-build |
133ac4 |
source_config
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
if [ "${2}" = "boot" -a "${ONBOOT}" = "no" ]; then
|
|
rpm-build |
133ac4 |
exit
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
if [ ! -f /var/lock/subsys/isdn ] && [ -x /etc/init.d/isdn ] ; then
|
|
rpm-build |
133ac4 |
/etc/init.d/isdn start
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# check that ipppd is available for syncppp
|
|
rpm-build |
133ac4 |
if [ "$ENCAP" = "syncppp" ]; then
|
|
rpm-build |
133ac4 |
if [ ! -x /sbin/ipppd ] && [ ! -x /usr/sbin/ipppd ] ; then
|
|
rpm-build |
133ac4 |
/usr/bin/logger -p daemon.info -t ifup-ippp "ipppd does not exist or is not executable"
|
|
rpm-build |
133ac4 |
exit 1
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# check that isdnctrl is available
|
|
rpm-build |
133ac4 |
if [ ! -x /sbin/isdnctrl ] && [ ! -x /usr/sbin/isdnctrl ] ; then
|
|
rpm-build |
133ac4 |
/usr/bin/logger -p daemon.info -t ifup-ippp "isdnctrl does not exist or is not executable"
|
|
rpm-build |
133ac4 |
exit 1
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# check all ISDN devices
|
|
rpm-build |
133ac4 |
if ! isdnctrl list all >/dev/null 2>&1 ; then
|
|
rpm-build |
133ac4 |
/usr/bin/logger -p daemon.info -t ifup-ippp "cannot list ISDN devices"
|
|
rpm-build |
133ac4 |
exit 1
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# check if device already is configured
|
|
rpm-build |
133ac4 |
isdnctrl list $DEVICE >/dev/null 2>&1 && exit 0
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
function log_echo()
|
|
rpm-build |
133ac4 |
{
|
|
rpm-build |
133ac4 |
/usr/bin/logger -p daemon.info -t ifup-ippp $"$*"
|
|
rpm-build |
133ac4 |
}
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
function log_isdnctrl()
|
|
rpm-build |
133ac4 |
{
|
|
rpm-build |
133ac4 |
/usr/bin/logger -p daemon.info -t ifup-ippp isdnctrl $*
|
|
rpm-build |
133ac4 |
isdnctrl $* >/dev/null 2>&1 || exit 1
|
|
rpm-build |
133ac4 |
}
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
function create_option_file()
|
|
rpm-build |
133ac4 |
{
|
|
rpm-build |
133ac4 |
umask 066
|
|
rpm-build |
133ac4 |
echo "$1" > /etc/ppp/ioption-secret-$DEVICE
|
|
rpm-build |
133ac4 |
umask 022
|
|
rpm-build |
133ac4 |
}
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
function start_ibod()
|
|
rpm-build |
133ac4 |
{
|
|
rpm-build |
133ac4 |
# don't start ibod, if it's running
|
|
rpm-build |
133ac4 |
[ -f /var/lock/subsys/ibod ] && return
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
device=$1
|
|
rpm-build |
133ac4 |
if [ -f /etc/isdn/ibod.cf ] && [ -x /usr/sbin/ibod ] ; then
|
|
rpm-build |
133ac4 |
ibod $device &
|
|
rpm-build |
133ac4 |
pid=$(pidof ibod)
|
|
rpm-build |
133ac4 |
[ -n "$pid" ] && touch /var/lock/subsys/ibod
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
}
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
function addprovider()
|
|
rpm-build |
133ac4 |
{
|
|
rpm-build |
133ac4 |
options=
|
|
rpm-build |
133ac4 |
if [ -z "$PHONE_OUT" ]; then
|
|
rpm-build |
133ac4 |
log_echo "Error: $1: no outgoing phone number set"
|
|
rpm-build |
133ac4 |
return 1
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set the encapsulation mode
|
|
rpm-build |
133ac4 |
[ -z "$ENCAP" ] && ENCAP="syncppp"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set the dial mode
|
|
rpm-build |
133ac4 |
[ -z "$DIALMODE" ] && DIALMODE="off"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
[ "$AUTH" = "none" -o "$AUTH" = "noauth" -o -z "$AUTH" ] && AUTH="-pap -chap"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set layer-2/3 protocol
|
|
rpm-build |
133ac4 |
[ -z "$L2_PROT" ] && L2_PROT="hdlc"
|
|
rpm-build |
133ac4 |
[ -z "$L3_PROT" ] && L3_PROT="trans"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# check local/remote IP
|
|
rpm-build |
133ac4 |
[ -z "$IPADDR" ] && IPADDR="0.0.0.0"
|
|
rpm-build |
133ac4 |
[ -z "$GATEWAY" ] && GATEWAY="0.0.0.0"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set default route
|
|
rpm-build |
133ac4 |
[ "$DEFROUTE" = "yes" ] && options="$options defaultroute deldefaultroute"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set authentication
|
|
rpm-build |
133ac4 |
_auth=$(echo "$AUTH" | sed 's/[a-z -]*//g')
|
|
rpm-build |
133ac4 |
if [ -n "$_auth" ]; then
|
|
rpm-build |
133ac4 |
if [ -z "$USER" -a "$DIALIN" != "on" ]; then
|
|
rpm-build |
133ac4 |
log_echo " Error: $1 (syncppp) user is not set"
|
|
rpm-build |
133ac4 |
return 1
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
if [ "$DIALIN" != "on" ]; then
|
|
rpm-build |
133ac4 |
# we should hide the user name, so i add user name to option file.
|
|
rpm-build |
133ac4 |
if [ "$AUTH" = "-pap +chap" ]; then
|
|
rpm-build |
133ac4 |
create_option_file "name \"$USER\""
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
create_option_file "user \"$USER\""
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
options="$options file /etc/ppp/ioption-secret-$DEVICE"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# authentication options:
|
|
rpm-build |
133ac4 |
# +pap and/or +chap does not work correct by dialout - remove
|
|
rpm-build |
133ac4 |
# them if it's configured as dialout
|
|
rpm-build |
133ac4 |
[ "$DIALIN" = "on" ] || AUTH=$(echo "$AUTH" | sed 's/+[a-z]*//g')
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# add ISDN device
|
|
rpm-build |
133ac4 |
log_isdnctrl addif $DEVICE
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set local MSN
|
|
rpm-build |
133ac4 |
[ -z "$MSN" ] || log_isdnctrl eaz $DEVICE $MSN
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set dialout numbers
|
|
rpm-build |
133ac4 |
if echo $COUNTRYCODE | grep ":" >/dev/null 2>&1 ; then
|
|
rpm-build |
133ac4 |
COUNTRYCODE="$(echo $COUNTRYCODE | cut -f 2 -d ':')"
|
|
rpm-build |
133ac4 |
[ "$COUNTRYCODE" = "0" ] && COUNTRYCODE=
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
COUNTRYCODE=
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
for i in $PHONE_OUT; do
|
|
rpm-build |
133ac4 |
log_isdnctrl addphone $DEVICE out $COUNTRYCODE$PREFIX$AREACODE$i
|
|
rpm-build |
133ac4 |
done
|
|
rpm-build |
133ac4 |
for i in $PHONE_IN; do
|
|
rpm-build |
133ac4 |
log_isdnctrl addphone $DEVICE in $i
|
|
rpm-build |
133ac4 |
done
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set layer-2/3 protocol
|
|
rpm-build |
133ac4 |
log_isdnctrl l2_prot $DEVICE $L2_PROT
|
|
rpm-build |
133ac4 |
log_isdnctrl l3_prot $DEVICE $L3_PROT
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set encapsulation
|
|
rpm-build |
133ac4 |
log_isdnctrl encap $DEVICE $ENCAP
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set dialmode
|
|
rpm-build |
133ac4 |
log_isdnctrl dialmode $DEVICE $DIALMODE
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
[ -n "$SECURE" ] && log_isdnctrl secure $DEVICE $SECURE
|
|
rpm-build |
133ac4 |
[ -n "$HUPTIMEOUT" ] && log_isdnctrl huptimeout $DEVICE $HUPTIMEOUT
|
|
rpm-build |
133ac4 |
[ -n "$CHARGEHUP" ] && log_isdnctrl chargehup $DEVICE $CHARGEHUP
|
|
rpm-build |
133ac4 |
[ -n "$CHARGEINT" ] && log_isdnctrl chargeint $DEVICE $CHARGEINT
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
[ -n "$IHUP" ] && log_isdnctrl ihup $DEVICE $IHUP
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set the number of dial atempts for each number
|
|
rpm-build |
133ac4 |
[ -n "$DIALMAX" ] && log_isdnctrl dialmax $DEVICE $DIALMAX
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set callback
|
|
rpm-build |
133ac4 |
if [ "$CALLBACK" = "out" -o "$CALLBACK" = "in" ] ; then
|
|
rpm-build |
133ac4 |
log_isdnctrl callback $DEVICE $CALLBACK
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
log_isdnctrl callback $DEVICE off
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
[ -n "$CBDELAY" ] && log_isdnctrl cbdelay $DEVICE $CBDELAY
|
|
rpm-build |
133ac4 |
[ -n "$CBHUP" ] && log_isdnctrl cbhup $DEVICE $CBHUP
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
options="$options ipparam $DEVNAME"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
[ "$ENCAP" = "syncppp" ] && log_isdnctrl pppbind $DEVICE
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
if [ "$IPADDR" = "0.0.0.0" ]; then
|
|
rpm-build |
133ac4 |
options="$options ipcp-accept-local"
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
if [ "$DIALIN" != "on" ]; then
|
|
rpm-build |
133ac4 |
options="$options noipdefault"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
# Add device
|
|
rpm-build |
133ac4 |
options="$options /dev/$DEVICE"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set channel bundling
|
|
rpm-build |
133ac4 |
if [ "$BUNDLING" = "yes" -o "$BUNDLING" = "on" ] && [ -n "$SLAVE_DEVICE" ]; then
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_MSN" ] && SLAVE_MSN="$MSN"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_PHONE_OUT" ] && SLAVE_PHONE_OUT="$PHONE_OUT"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_PHONE_IN" ] && SLAVE_PHONE_IN="$PHONE_IN"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_HUPTIMEOUT" ] && SLAVE_HUPTIMEOUT="$HUPTIMEOUT"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_CHARGEHUP" ] && SLAVE_CHARGEHUP="$CHARGEHUP"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_CHARGEINT" ] && SLAVE_CHARGEINT="$CHARGEINT"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_CBHUP" ] && SLAVE_CBHUP="$CBHUP"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_IHUP" ] && SLAVE_IHUP="$IHUP"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_DIALMAX" ] && SLAVE_DIALMAX="$DIALMAX"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_CALLBACK" ] && SLAVE_CALLBACK="$CALLBACK"
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_CBDELAY" ] && SLAVE_CBDELAY="$CBDELAY"
|
|
rpm-build |
133ac4 |
if [ "$DIALIN" != "on" ] ; then
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_DIALMODE" ] && SLAVE_DIALMODE="auto"
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
# Master should not dial by default on incoming MPPP
|
|
rpm-build |
133ac4 |
[ -z "$SLAVE_DIALMODE" ] && SLAVE_DIALMODE="$DIALMODE"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
slave=$SLAVE_DEVICE
|
|
rpm-build |
133ac4 |
options="$options /dev/$slave +mp"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Create slave and set options
|
|
rpm-build |
133ac4 |
log_isdnctrl addslave $DEVICE $slave
|
|
rpm-build |
133ac4 |
[ -z $SLAVE_MSN ] || log_isdnctrl eaz $slave $SLAVE_MSN
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set phone number
|
|
rpm-build |
133ac4 |
for i in $SLAVE_PHONE_OUT; do
|
|
rpm-build |
133ac4 |
log_isdnctrl addphone $slave out $COUNTRYCODE$PREFIX$AREACODE$i
|
|
rpm-build |
133ac4 |
done
|
|
rpm-build |
133ac4 |
for i in $SLAVE_PHONE_IN; do
|
|
rpm-build |
133ac4 |
log_isdnctrl addphone $slave in $i
|
|
rpm-build |
133ac4 |
done
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set layer-2/3 protocol
|
|
rpm-build |
133ac4 |
log_isdnctrl l2_prot $slave $L2_PROT
|
|
rpm-build |
133ac4 |
log_isdnctrl l3_prot $slave $L3_PROT
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set encapsulation
|
|
rpm-build |
133ac4 |
log_isdnctrl encap $slave $ENCAP
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set dial mode
|
|
rpm-build |
133ac4 |
log_isdnctrl dialmode $slave $SLAVE_DIALMODE
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
[ -n "$SECURE" ] && log_isdnctrl secure $slave $SECURE
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_HUPTIMEOUT" ] && log_isdnctrl huptimeout $slave $SLAVE_HUPTIMEOUT
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_CHARGEHUP" ] && log_isdnctrl chargehup $slave $SLAVE_CHARGEHUP
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_CHARGEINT" ] && log_isdnctrl chargeint $slave $SLAVE_CHARGEINT
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_IHUP" ] && log_isdnctrl ihup $slave $SLAVE_IHUP
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_DIALMAX" ] && log_isdnctrl dialmax $slave $SLAVE_DIALMAX
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set callback
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_CBHUP" ] && log_isdnctrl cbhup $slave $SLAVE_CBHUP
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_CALLBACK" ] || SLAVE_CALLBACK="off"
|
|
rpm-build |
133ac4 |
log_isdnctrl callback $slave $SLAVE_CALLBACK
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_CBDELAY" ] && log_isdnctrl cbdelay $DEVICE $SLAVE_CBDELAY
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# options for master device
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_DELAY" ] && log_isdnctrl sdelay $DEVICE $SLAVE_DELAY
|
|
rpm-build |
133ac4 |
[ -n "$SLAVE_TRIGGER" ] && log_isdnctrl trigger $DEVICE $SLAVE_TRIGGER
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
if [ "$GATEWAY" = "0.0.0.0" ]; then
|
|
rpm-build |
133ac4 |
if [ "$DIALIN" != "on" ]; then
|
|
rpm-build |
133ac4 |
options="$options ipcp-accept-remote"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
options="$IPADDR:$GATEWAY $options"
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
options="$options $IPADDR:$GATEWAY"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Van Jacobson style TCP/IP header compression and
|
|
rpm-build |
133ac4 |
# VJ connection-ID compression
|
|
rpm-build |
133ac4 |
[ "$VJ" = "off" ] && options="$options -vj"
|
|
rpm-build |
133ac4 |
[ "$VJCCOMP" = "off" ] && options="$options -vjccomp"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Address/Control compression, protocol field compression,
|
|
rpm-build |
133ac4 |
[ "$AC" = "off" ] && options="$options -ac"
|
|
rpm-build |
133ac4 |
[ "$PC" = "off" ] && options="$options -pc"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# BSD-Compression scheme
|
|
rpm-build |
133ac4 |
if [ "$BSDCOMP" = "on" ] ; then
|
|
rpm-build |
133ac4 |
options="$options bsdcomp 9,9"
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
options="$options -bsdcomp"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
# Stac compression
|
|
rpm-build |
133ac4 |
if [ "$LZS" = "on" ] ; then
|
|
rpm-build |
133ac4 |
# supports LZS check mode 3 and 4
|
|
rpm-build |
133ac4 |
[ -n "$LZS_MODE" ] || LZS_MODE="4"
|
|
rpm-build |
133ac4 |
[ "$LZS_MODE" = "3" ] && options="$options lzs 1"
|
|
rpm-build |
133ac4 |
[ "$LZS_MODE" = "4" ] && options="$options lzs 1:4"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Set max receive and max transmit units
|
|
rpm-build |
133ac4 |
[ -n "$MRU" ] && options="$options mru $MRU"
|
|
rpm-build |
133ac4 |
[ -n "$MTU" ] && options="$options mtu $MTU"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set CBCP protocoll
|
|
rpm-build |
133ac4 |
if [ "$CBCP" = "on" ] ; then
|
|
rpm-build |
133ac4 |
if [ -n "$CBCP_MSN" ] ; then
|
|
rpm-build |
133ac4 |
# User managed callback
|
|
rpm-build |
133ac4 |
options="$options callback $CBCP_MSN"
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
# admin managed callback, it's enabled by default
|
|
rpm-build |
133ac4 |
options="$options callback 6"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
# Disable CBCP
|
|
rpm-build |
133ac4 |
options="$options -callback-cbcp"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set CCP protocoll
|
|
rpm-build |
133ac4 |
[ "$CCP" = "off" ] && options="$options noccp"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set host name
|
|
rpm-build |
133ac4 |
[ -n "$ISDN_HOSTNAME" ] && options="$options remotename $ISDN_HOSTNAME"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Set authentication
|
|
rpm-build |
133ac4 |
for i in $AUTH ; do
|
|
rpm-build |
133ac4 |
options="$options $i"
|
|
rpm-build |
133ac4 |
done
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# add ppp options
|
|
rpm-build |
133ac4 |
for i in $PPPOPTIONS ; do
|
|
rpm-build |
133ac4 |
options="$options $i"
|
|
rpm-build |
133ac4 |
done
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# check dns entry
|
|
rpm-build |
133ac4 |
if [ -z "$DNS1" -a -z "$DNS2" ]; then
|
|
rpm-build |
133ac4 |
options="$options ms-get-dns"
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
[ -n "$DNS1" ] && options="$options ms-dns $DNS1"
|
|
rpm-build |
133ac4 |
[ -n "$DNS2" ] && options="$options ms-dns $DNS2"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set debug
|
|
rpm-build |
133ac4 |
[ "$DEBUG" = "yes" ] && options="-d $options"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set netmask, if available
|
|
rpm-build |
133ac4 |
[ -n "$NETMASK" ] && {
|
|
rpm-build |
133ac4 |
val=$(ipcalc --prefix $IPADDR $NETMASK)
|
|
rpm-build |
133ac4 |
pfx=${val##PREFIX=}
|
|
rpm-build |
133ac4 |
}
|
|
rpm-build |
133ac4 |
# activate ISDN device
|
|
rpm-build |
133ac4 |
/usr/bin/logger -p daemon.info -t ifup-ippp "ip addr add $IPADDR peer $GATEWAY${pfx:/$pfx} dev $DEVICE"
|
|
rpm-build |
133ac4 |
ip addr add $IPADDR peer $GATEWAY${pfx:/$pfx} dev $DEVICE
|
|
Packit Service |
8029ae |
set_link_up $DEVICE
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
if [ "$ENCAP" = "syncppp" ]; then
|
|
rpm-build |
133ac4 |
# start ipppd daemon
|
|
rpm-build |
133ac4 |
/usr/bin/logger -p daemon.info -t ifup-ippp "ipppd $options $netmask"
|
|
rpm-build |
133ac4 |
ipppd $options $netmask >/dev/null 2>&1
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# start ibod daemon
|
|
rpm-build |
133ac4 |
if [ "$DIALIN" != "on" ]; then
|
|
rpm-build |
133ac4 |
[ "$BUNDLING" = "yes" -o "$BUNDLING" = "on" ] && [ -n "$SLAVE_DEVICE" ] && start_ibod $DEVICE
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# set default gateway for dial on demand
|
|
rpm-build |
133ac4 |
if [ "$DIALMODE" = "auto" ] ; then
|
|
rpm-build |
133ac4 |
echo 1 > /proc/sys/net/ipv4/ip_dynaddr
|
|
rpm-build |
133ac4 |
if [ "$DEFROUTE" = "yes" ] ; then
|
|
rpm-build |
133ac4 |
if [ "$GATEWAY" = "0.0.0.0" ]; then
|
|
rpm-build |
133ac4 |
ip route replace default ${METRIC:+metric $METRIC} dev ${DEVICE} >/dev/null 2>&1
|
|
rpm-build |
133ac4 |
else
|
|
rpm-build |
133ac4 |
ip route replace default ${METRIC:+metric $METRIC} via ${GATEWAY} dev ${DEVICE} >/dev/null 2>&1
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Setup IPv6
|
|
rpm-build |
133ac4 |
if ! is_false "$IPV6INIT" && ! [[ -z "$IPV6ADDR" ]]; then
|
|
rpm-build |
133ac4 |
# Native IPv6 use of device configured, check of encapsulation required
|
|
rpm-build |
133ac4 |
if [ "$ENCAP" = "syncppp" ]; then
|
|
rpm-build |
133ac4 |
echo $"Warning: ipppd (kernel 2.4.x and below) doesn't support IPv6 using encapsulation 'syncppp'"
|
|
rpm-build |
133ac4 |
elif [ "$ENCAP" = "rawip" ]; then
|
|
rpm-build |
133ac4 |
echo $"Warning: link doesn't support IPv6 using encapsulation 'rawip'"
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
fi
|
|
rpm-build |
133ac4 |
/etc/sysconfig/network-scripts/ifup-ipv6 $CONFIG
|
|
rpm-build |
133ac4 |
}
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
addprovider || exit 1
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
exit 0
|