Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
i4l-base
i4l-base-postprocess
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File i4l-base-postprocess of Package i4l-base
#! /bin/bash # Copyright (c) 2002,2003,2004 SuSE Linux AG, Nuernberg, Germany. # All rights reserved. # # Author: Karsten Keil <kkeil@suse.de> # # # This module postprocesses ISDN configuration and modifies/creates # the setup files used for ifup ifdown ipppd ... # # check if we are started as root # only one of UID and USER must be set correctly if test "$UID" != 0 -a "$USER" != root; then echo "You must be root to start $0." exit 1 fi r=$ROOT test -f /etc/sysconfig/i4l-base && . /etc/sysconfig/i4l-base # local functions # creates $1 file from $2 and setup the header create_autofile() { cat << EOT > $1 # # DO NOT EDIT THIS FILE !!! # # This file was autogenerated by postprocess.isdn from $2. # Edit $2 instead and run /etc/sysconfig/isdn/scripts/postprocess . # EOT } # # writes a VAR_NAME="VAR_CONTENS" # $1 VAR_NAME # write_value() { eval x=\$$1 test "${x}v" != "v" && echo "$1=\"$x\"" } # # add entry to /etc/ppp/{chap,pap}-secrets # # $1 filename # $2 username # $3 secret # $4 remote_name (default *) # add_secret() { local user host secret rest suser found=no x x=${1##*/} echo -n "$x... " suser=${2//'\\'/'\\'} echo "#postprocess.isdn modified" > $1.tmp_host while read -r line ; do case $line in "#SuSEconfig.isdn entry"* | "#postprocess.isdn entry"*) comment=$line continue ;; "#SuSEconfig.isdn" | "#postprocess.isdn"*) ;; "#"*|"") echo "$line" >> $1.tmp ;; *) read -r user host secret rest < <(echo "$line") user=${user//\"/} if [ "$user" = "$suser" -a "$host" = "$4" ]; then if [ "$host" = "*" ]; then echo "#postprocess.isdn entry" >> $1.tmp echo "\"$suser\" $host \"$3\" $rest" >> $1.tmp else echo "#postprocess.isdn entry" >> $1.tmp_host echo "\"$suser\" $host \"$3\" $rest" >> $1.tmp_host fi found=yes else if [ "$host" = "*" ]; then test -n "$comment" && echo "$comment" >> $1.tmp echo "$line" >> $1.tmp else test -n "$comment" && echo "$comment" >> $1.tmp_host echo "$line" >> $1.tmp_host fi fi ;; esac comment="" done < <(cat $1) if [ "$found" = "no" ]; then if [ "$4" = "*" ]; then echo "#postprocess.isdn entry" >> $1.tmp echo "\"$suser\" $4 \"$3\" $rest" >> $1.tmp else echo "#postprocess.isdn entry" >> $1.tmp_host echo "\"$suser\" $4 \"$3\" $rest" >> $1.tmp_host fi fi mv $1.tmp_host $1 cat $1.tmp >> $1 rm -f $1.tmp chmod 600 $1 chown root:root $1 } # # handle defaultroute # # $1 device # $2 add defaultroute (yes/no) default no # $3 gateway or __dynamic__ (optional) # $4 netmask (optional) # make_defaultroute() { echo "make_defaultroute($@)" dev=$1 test -z "$dev" && return op="delete" shift test $# -gt 0 -a "$1" = "yes" && op="replace" shift gw="" test $# -gt 0 && gw=$1 shift test -z "$gw" -o "$gw" = "__dynamic__" && gw="0.0.0.0" mask="" test $# -gt 0 && mask=$1 shift mask=${mask:-0.0.0.0} extra=$@ # echo "dev:$dev op:$op gw:$gw mask:$mask extra:$extra" ROUTECONF="../network/routes" TMPROUTECONF="${ROUTECONF}.tmp" rm -f $TMPROUTECONF found="no" comment="" if [ -f "$ROUTECONF" ] ; then touch $TMPROUTECONF while read DEST GWAY MASK IFACE TYPE IPOPTS ; do LINE="$DEST $GWAY $MASK $IFACE $TYPE $IPOPTS" #echo "process line $LINE" case $DEST in \#SuSEconfig.isdn*) comment=$LINE; continue ;; \#postprocess.isdn*) comment=$LINE; continue ;; \#*|"") echo "$LINE" >> $TMPROUTECONF; comment=""; continue ;; esac if [ "$IFACE" = "$dev" -a "$DEST" = "default" ] ; then test "$op" = "delete" && continue LINE="default $gw $mask $dev $extra" # echo "new: $LINE" echo "#postprocess.isdn generated line" >> $TMPROUTECONF echo $LINE >> $TMPROUTECONF found="yes" else test -n "$comment" && echo "$comment" >> $TMPROUTECONF echo "$LINE" >> $TMPROUTECONF fi comment="" done < <(cat $ROUTECONF) mv $TMPROUTECONF $ROUTECONF fi #echo "found: $found" if [ "$found" = "no" ] ; then if [ "$op" = "delete" ] ; then return else echo "#postprocess.isdn generated line" >> $ROUTECONF echo default $gw $mask $dev $extra >> $ROUTECONF fi fi } strip_leadingzero() { local x eval x=\${$1} test -z "$x" && return case $x in 0*) x=${x#0} ;; esac case $x in 0*) x=${x#0} ;; esac eval $1=$x } # # removes variable from file # $1 file # $2 name # remove_value_from_file() { local nf=$1.new rm -f $nf while read line ; do case $line in "#"*|"") echo $line >> $nf ;; *=*) test "${line%%=*}" = "$2" || echo $line >> $nf ;; *) echo $line >> $nf ;; esac done < <(cat $1) mv $nf $1 } # # replace value of variable in file # $1 file # $2 name # $3 new value replace_value_in_file() { local nf=$1.new rm -f $nf while read line ; do case $line in "#"*|"") echo $line >> $nf ;; *=*) if [ "${line%%=*}" = "$2" ]; then echo "${2}='$3'" >> $nf else echo $line >> $nf fi ;; *) echo $line >> $nf ;; esac done < <(cat $1) mv $nf $1 } # # VARS # # all options which go into ifcfg-ippp and ifcfg-isdn IFCFG_OPTIONS="\ STARTMODE IPADDR PTPADDR DEFAULTROUTE FIREWALL MSN DIALMODE DIALPREFIX DIALMAX REMOTE_OUT REMOTE_IN PROVIDER SECURE CHARGEHUP CALLBACK CBDELAY CBHUP IHUP VERBOSE_LEVEL SLAVES MULTILINK SLAVEMSN SLAVE_IN SLAVE_OUT LAYER2 LAYER3 ENCAP IP_RESEND IP_RESEND_PARAMETER USERCONTROL NETMASK " # all options which go into ifcfg-ippp IFCFG_IPPP_OPTIONS="DYNAMICIP IPPPD_OPTIONS ASKPASSWORD MTU MRU RUN_POLL_TCPIP" # all options which go into ifcfg-isdn IFCFG_ISDN_OPTIONS="" # all options from provider file PROVIDER_OPTIONS="\ PROVIDERNAME ISDNSUPPORTED DEMAND MODIFYDNS DNS1 DNS2 ENCAP USERNAME PASSWORD IDLETIME ASKPASSWORD PHONE REMOTE_NAME " # # Here is a little problem with implementation # DIALPREFIX and AREACODE is bound to an controller (which is correct, # since the line has these properties) but the DIALPREFIX is used in # global place and on connection setup # So we use the first DIALPREFIX and AREACODE if any was set. # GLOBAL_DIALPREFIX="" GLOBAL_AREACODE="" # # Main script # # check for used directories for i in $r/etc/sysconfig/network $r/etc/sysconfig/network/providers \ $r/etc/sysconfig/isdn $r/etc/ppp $r/etc/isdn ; do if test ! -d $i ; then echo "directory $i not found." exit 1 fi done # common config options are in /etc/sysconfig/isdn/config COMMON_CONFIG=$r/etc/sysconfig/isdn/config test -f $COMMON_CONFIG || COMMON_CONFIG="" if [ -z "$r" -a -r /etc/sysconfig/isdn/update.hwscan ]; then . /etc/sysconfig/isdn/update.hwscan mv /etc/sysconfig/isdn/update.hwscan /etc/sysconfig/isdn/update.hwscan.done fi # # update /etc/pcmcia/avm.conf if nessesary # if [ -d $r/etc/pcmcia -a -f $r/etc/pcmcia/avm.conf ]; then grep -qs fcpcmcia_cs $r/etc/pcmcia/avm.conf if [ $? = 1 ]; then cp $r/etc/pcmcia/avm.conf $r/etc/pcmcia/avm.conf.orig sed '6 a\ device "fcpcmcia_cs"\ class "isdn" module "fcpcmcia_cs"\ ' $r/etc/pcmcia/avm.conf.orig > $r/etc/pcmcia/avm.conf fi fi CONTRFILES="" cd $r/etc/sysconfig/isdn for i in cfg-contr*; do case $i in *~*|*.*) # drop backup files, rpm{save,new,orig} ;; *) CONTRFILES="$CONTRFILES $i" ;; esac done CAPIFILE="$r/etc/capi.conf" test -f ${CAPIFILE} && mv ${CAPIFILE} ${CAPIFILE}.postprocess.saved echo "#postprocess.isdn generated" > $CAPIFILE echo "# card file proto io irq mem cardnr options" >> $CAPIFILE CAPIDRIVERS="b1isa b1pci b1pcmcia c2 c4 fcclassic fcpci fcpcmcia fcdsl fcdsl2 fcdslsl t1isa t1pci" for i in $CAPIDRIVERS; do eval capi_nr_$i=1 done set -- $CONTRFILES for name in "${@#cfg-}"; do ifile="cfg-$name" test -f "$ifile" || continue echo "Reading $ifile ... " unset DRIVER unset PROTOCOL unset PARA_SUBTYPE unset PARA_TYPE unset PARA_IO unset PARA_IRQ unset B1_FIRM unset B1_PROTO unset DRIVER_OPTIONS . $ifile GLOBAL_AREACODE=${GLOBAL_AREACODE:-$AREACODE} GLOBAL_DIALPREFIX=${GLOBAL_DIALPREFIX:-$DIALPREFIX} # create isdnlog optfile if not exist and a isdnlog compatible controller # and protocol is used USEISDNLOG="" case $PROTOCOL in euro) USEISDNLOG="yes" ;; 1tr6) USEISDNLOG="yes" ;; *) USEISDNLOG="" ;; esac test -n "$USEISDNLOG" && case $DRIVER in hisax*) USEISDNLOG="yes" ;; b1*) USEISDNLOG="yes" ;; c2*) USEISDNLOG="yes" ;; c4*) USEISDNLOG="yes" ;; eicon) USEISDNLOG="yes" ;; fcpci) USEISDNLOG="yes" ;; fcclassic) USEISDNLOG="yes" ;; fcpnp) USEISDNLOG="yes" ;; fcusb) USEISDNLOG="yes" ;; fcusb2) USEISDNLOG="yes" ;; fxusb) USEISDNLOG="yes" ;; fxusb_CZ) USEISDNLOG="yes" ;; fcdsl) USEISDNLOG="yes" ;; fcdsl2) USEISDNLOG="yes" ;; fcdslsl) USEISDNLOG="" ;; *) USEISDNLOG="" ;; esac ilogfile=$r/etc/isdn/isdnlog.options.${name} test -f ${ilogfile} -o -z "$USEISDNLOG" || \ cp $r/etc/isdn/isdnlog.options.templ ${ilogfile} if [ -f ${ilogfile} ]; then echo "Modify ${ilogfile}" echo "#postprocess.isdn modified" > ${ilogfile}.new while read -r _line ; do case $_line in "#SuSEconfig"* | "#postprocess"*) ;; # this is the example line "# amt=0:80:81:82:83:84"*) echo -E "$_line" >>${ilogfile}.new ;; "# amt"*|"amt"*) if [ -n "$DIALPREFIX" ]; then echo "amt=$DIALPREFIX" >>${ilogfile}.new else echo "# amt=" >>${ilogfile}.new fi ;; *) echo -E "$_line" >>${ilogfile}.new ;; esac done < <(cat ${ilogfile}) mv ${ilogfile}.new ${ilogfile} fi test -n "${DRIVER_OPTIONS}" && DRIVER_OPTIONS=" ${DRIVER_OPTIONS}" eval capi_nr=\$capi_nr_$DRIVER if [ "$DRIVER" = "fcpci" -o "$DRIVER" = "fcpnp" -o \ "$DRIVER" = "fcpcmcia" ]; then echo "$DRIVER - - - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi if [ "$DRIVER" = "fcclassic" ]; then echo "$DRIVER - - $PARA_IO $PARA_IRQ - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi if [ "$DRIVER" = "fcdsl" ]; then echo "$DRIVER fdslbase.bin - - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi if [ "$DRIVER" = "fcdsl2" ]; then echo "$DRIVER fds2base.bin - - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi if [ "$DRIVER" = "fcdslsl" ]; then echo "$DRIVER fdssbase.bin - - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi if [ "$PROTOCOL" = "1tr6" ]; then B1_PROTO=1TR6 B1_FIRM=b1-1tr6.t4 elif [ "$PROTOCOL" = "ni1" ]; then B1_PROTO=NI1 B1_FIRM=b1-usa.t4 else B1_PROTO=DSS1 B1_FIRM=b1.t4 fi if [ "$DRIVER" = "b1isa" ]; then echo "$DRIVER $B1_FIRM $B1_PROTO $PARA_IO $PARA_IRQ - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi if [ "$DRIVER" = "b1pci" -o "$DRIVER" = "b1pcmcia" ]; then echo "$DRIVER $B1_FIRM $B1_PROTO - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi if [ "$DRIVER" = "c4" ]; then if [ "$PARA_SUBTYPE" = "6" ]; then # C2 DRIVER="c2" capi_nr=$capi_nr_c2 echo "c2 c2.bin DSS1 - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE capi_nr=$(($capi_nr + 1)) echo "c2 - DSS1 - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE else echo "$DRIVER c4.bin DSS1 - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE capi_nr=$(($capi_nr + 1)) echo "$DRIVER - DSS1 - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE capi_nr=$(($capi_nr + 1)) echo "$DRIVER - DSS1 - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE capi_nr=$(($capi_nr + 1)) echo "$DRIVER - DSS1 - - - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi fi if [ "$DRIVER" = "t1isa" -o "$DRIVER" = "t1pci" ]; then case "$PARA_SUBTYPE" in "0") #T1 ISA T1_FIRM="t1" ;; "1")T1B ISA T1_FIRM="t1b" ;; "2")T1 PCI T1_FIRM="t1" PARA_IO="-" PARA_IRQ="-" ;; "3")T1B PCI T1_FIRM="t1b" PARA_IO="-" PARA_IRQ="-" ;; esac if [ "$PROTOCOL" = "1tr6" ]; then T1_PROTO=1TR6 T1_FIRM="${T1_FIRM}-1tr6.t4" else T1_PROTO=DSS1 T1_FIRM="${T1_FIRM}.t4" fi echo "$DRIVER $T1_FIRM $T1_PROTO $PARA_IO $PARA_IRQ - ${capi_nr}${DRIVER_OPTIONS}" >> $CAPIFILE fi capi_nr=$(($capi_nr + 1)) eval capi_nr_$DRIVER=\$capi_nr # handle pcmcia hisax/fcpcmcia PCMCIACFG=$r/etc/pcmcia/avm.conf test -f ${PCMCIACFG} || continue if [ "$DRIVER" = "fcpcmcia" ]; then mv ${PCMCIACFG} ${PCMCIACFG}.old sed 's/bind "avma1_cs"/bind "fcpcmcia_cs"/g' ${PCMCIACFG}.old > ${PCMCIACFG} elif [ "$DRIVER" = "hisax" -a "$PARA_TYPE" = "26" ]; then mv ${PCMCIACFG} ${PCMCIACFG}.old sed 's/bind "fcpcmcia_cs"/bind "avma1_cs"/g' ${PCMCIACFG}.old > ${PCMCIACFG} fi done O_COUNTRY=default default="" # read in old set as fallback test -f $r/etc/isdn/isdn.conf && while read -r _w1 _w2 _w3 _rest ; do case $_w1 in "AREACODE") O_AREACODE=$_w3 ;; "AREACODE=") O_AREACODE=$_w2 ;; "AREACODE="*) O_AREACODE=${_w1#AREACODE=} ;; "COUNTRYCODE") O_COUNTRYCODE=$_w3 ;; "COUNTRYCODE=") O_COUNTRYCODE=$_w2 ;; "COUNTRYCODE="*) O_COUNTRYCODE=${_w1#COUNTRYCODE=} ;; "#SuSEconfig.isdn"|"#postprocess.isdn") test -n "$_w3" && O_COUNTRY=$_w3 ;; esac done < <(cat $r/etc/isdn/isdn.conf) strip_leadingzero O_AREACODE if [ -n "$GLOBAL_AREACODE" ]; then case $GLOBAL_AREACODE in 00*) GLOBAL_AREACODE="+${GLOBAL_AREACODE#00}" ;; esac case $GLOBAL_AREACODE in "+49"*) COUNTRYCODE=49 AREACODE=${GLOBAL_AREACODE#+49} ;; "+43"*) COUNTRYCODE=43 AREACODE=${GLOBAL_AREACODE#+43} ;; "+41"*) COUNTRYCODE=41 AREACODE=${GLOBAL_AREACODE#+41} ;; "+421"*) COUNTRYCODE=421 AREACODE=${GLOBAL_AREACODE#+421} ;; "+352"*) COUNTRYCODE=352 AREACODE=${GLOBAL_AREACODE#+352} ;; "+31"*) COUNTRYCODE=31 AREACODE=${GLOBAL_AREACODE#+31} ;; "+47"*) COUNTRYCODE=47 AREACODE=${GLOBAL_AREACODE#+47} ;; "+48"*) COUNTRYCODE=48 AREACODE=${GLOBAL_AREACODE#+48} ;; "+"*) read COUNTRYCODE AREACODE < <(echo $GLOBAL_AREACODE) COUNTRYCODE=${COUNTRYCODE#+} ;; *) COUNTRYCODE=$O_COUNTRYCODE AREACODE=$GLOBAL_AREACODE ;; esac AREACODE=${AREACODE// } else COUNTRYCODE=$O_COUNTRYCODE AREACODE=$O_AREACODE default=yes fi case $COUNTRYCODE in 49) COUNTRY=de;; 48) COUNTRY=pl;; 47) COUNTRY=no;; 43) COUNTRY=at;; 421) COUNTRY=sk;; 41) COUNTRY=ch;; 352) COUNTRY=lu;; 31) COUNTRY=nl;; *) COUNTRY=unknown;; esac if [ "$O_COUNTRY" = "default" ]; then COUNTRYCONF=$r/etc/isdn/isdn.conf.${COUNTRY} else if [ -f $r/etc/isdn/isdn.conf ]; then if [ "$O_COUNTRY" = "$COUNTRY" ]; then COUNTRYCONF=$r/etc/isdn/isdn.conf else COUNTRYCONF=$r/etc/isdn/isdn.conf.${COUNTRY} fi else COUNTRYCONF=$r/etc/isdn/isdn.conf.${COUNTRY} fi fi if [ ! -f $COUNTRYCONF ]; then if [ "$COUNTRY" = "sk" -o "$COUNTRY" = "ch" ]; then sed "s/-xx/-${COUNTRY}/g" $r/etc/isdn/isdn.conf.unknown >$r/etc/isdn/isdn.conf.${COUNTRY} fi fi test -f $COUNTRYCONF || COUNTRYCONF=$r/etc/isdn/isdn.conf test -f $r/etc/isdn/isdn.conf && \ cp $r/etc/isdn/isdn.conf $r/etc/isdn/isdn.conf.postprocess.old if [ -n "$COUNTRYCODE" -a -n "$AREACODE" ]; then echo "Modify isdn.conf" if [ "$default" = "yes" ]; then echo "#postprocess.isdn modified default" > $r/etc/isdn/isdn.conf.new else echo "#postprocess.isdn modified $COUNTRY" > $r/etc/isdn/isdn.conf.new fi while read -r _line ; do case $_line in "#SuSEconfig"* | "#postprocess"*) ;; "AREACODE"*) echo "AREACODE = $AREACODE" >>$r/etc/isdn/isdn.conf.new ;; "COUNTRYCODE"*) echo "COUNTRYCODE = $COUNTRYCODE" >>$r/etc/isdn/isdn.conf.new ;; *) echo -E "$_line" >>$r/etc/isdn/isdn.conf.new ;; esac done < <(cat $COUNTRYCONF) mv $r/etc/isdn/isdn.conf.new $r/etc/isdn/isdn.conf fi # # delete old files # cd $r/etc/sysconfig/network for i in ifcfg-ippp* ifcfg-isdn* ; do dev="${i#ifcfg-}" case $i in ifcfg-ippp\*|ifcfg-isdn\*) # drop no matching file continue ;; *~*|*.*) # drop backup files, rpm{save,new,orig} continue ;; ifcfg-ippp*) # optfile prov=`grep "^PROVIDER" $i` test -n "$prov" && eval $prov test -n "$PROVIDER" && rm -f $r/etc/ppp/options.${dev}.${PROVIDER} ;; esac # # here we cleanup old ifroute-${dev} from 8.0 # in current version a default route setting # is placed in /etc/sysconfig/network/routes # to keep /etc/sysconfig/network/ifroute-${dev} # for special cases if [ -f ifroute-${dev} ]; then com=0 nocom=0 while read DEST GWAY MASK IFACE TYPE IPOPTS ; do LINE="$DEST $GWAY $MASK $IFACE $TYPE $IPOPTS" case $DEST in \#SuSEconfig.isdn) com=1; continue ;; \#postprocess.isdn) com=1; continue ;; \#*|"") continue ;; *) if [ $com -eq 1 ]; then com = 0 else nocom=$(($nocom + 1)) fi ;; esac done < <(cat ifroute-${dev}) test $nocom -eq 0 && rm -f ifroute-${dev} fi # remove entry from routes make_defaultroute ${dev} no rm -f $i done # loop trough provider definitions and create # pap/chap entries for ISDN Provider if [ "$MODIFY_SECRETS" != "no" ]; then cd $r/etc/sysconfig/network/providers for i in *; do case $i in *~*|*.*) # drop backup files ;; "*") ;; *) for v in $PROVIDER_OPTIONS ; do unset $v done . $i echo -n "provider $i " REMOTE_NAME=${REMOTE_NAME:-*} if [ "$ISDNSUPPORTED" = "yes" ]; then add_secret $r/etc/ppp/pap-secrets "$USERNAME" "$PASSWORD" "$REMOTE_NAME" add_secret $r/etc/ppp/chap-secrets "$USERNAME" "$PASSWORD" "$REMOTE_NAME" fi echo " done" ;; esac done else echo "skip modify of pap-secrets/chap-secrets because of MODIFY_SECRETS=$MODIFY_SECRETS" fi # loop trough isdn connection setups and create # etc/sysconfig/network/ifcfg files MAX_IDX=-1; NETFILES="" cd $r/etc/sysconfig/isdn for i in cfg-net*; do case $i in *~*|*.*) # drop backup files, rpm{save,new,orig} ;; "cfg-net*") ;; *) NETFILES="$NETFILES $i" IDX=${i#cfg-net} test $IDX -ge $MAX_IDX && MAX_IDX=$IDX ;; esac done SLAVE_IDX=${MAX_IDX}; set -- $NETFILES for name in "${@#cfg-}"; do # cleanup old values for v in $IFCFG_OPTIONS $IFCFG_IPPP_OPTIONS $IFCFG_ISDN_OPTIONS \ SLAVECNT $PROVIDER_OPTIONS OLDIDLETIME SMPPPD_IGNORE ; do unset $v done IDX=${name#net} ifile="cfg-$name" test -f "$ifile" || continue echo -n "Reading $ifile," test -n "$COMMON_CONFIG" && . $COMMON_CONFIG . $ifile # need for update OLDIDLETIME=${IDLETIME} test -z "$DIALPREFIX" && DIALPREFIX=${GLOBAL_DIALPREFIX} LAYER2=${LAYER2:-hdlc} LAYER3=${LAYER3:-trans} SECURE=${SECURE:-on} PROVIDERFILE=${PROVIDER} if [ -f "../network/providers/${PROVIDERFILE}" ]; then echo "${PROVIDERFILE} ..." . ../network/providers/${PROVIDERFILE} else echo "${PROVIDERFILE} not found" continue fi PROVIDERNAME=${PROVIDER} PROVIDER=${PROVIDERFILE} # Update $ifile if it is a old version if [ -n "$OLDIDLETIME" ]; then remove_value_from_file $ifile IDLETIME replace_value_in_file ../network/providers/${PROVIDERFILE} IDLETIME $OLDIDLETIME fi if [ -n "$USEPEERDNS" ]; then remove_value_from_file $ifile USEPEERDNS replace_value_in_file ../network/providers/${PROVIDERFILE} MODIFYDNS $USEPEERDNS fi IPADDR=${IPADDR:-0.0.0.0} PTPADDR=${PTPADDR:-0.0.0.0} DIALMODE=${DIALMODE:-manual} test "$DEMAND" = "yes" && DIALMODE="auto" case "$PROTOCOL" in syncppp) DEVICETYPE="ippp" SMPPPD_IGNORE=${SMPPPD_IGNORE-no} if [ -z "$USERCONTROL" ] ; then if [ "$SMPPPD_IGNORE" = "yes" ] ; then USERCONTROL=no else if [ -z "$REMOTE_IN" -a "$SECURE" = "on" ] ; then USERCONTROL=yes else USERCONTROL=no fi fi fi DEVICE="${DEVICETYPE}${IDX}" echo -n "Writing ifcfg-${DEVICE} ... " ifcfgfile="../network/ifcfg-${DEVICE}" create_autofile $ifcfgfile /etc/sysconfig/isdn/$ifile ENCAP="syncppp" SLAVES="" if [ "$MULTILINK" = "yes" ] ; then test -z "$SLAVECNT" && SLAVECNT=1 while [ $SLAVECNT -gt 0 ]; do test -n "$SLAVES" && SLAVES="${SLAVES} " SLAVE_IDX=$(($SLAVE_IDX + 1)) SLAVES="${SLAVES}${DEVICETYPE}${SLAVE_IDX}" SLAVECNT=$(($SLAVECNT - 1)) done fi for v in $IFCFG_OPTIONS $IFCFG_IPPP_OPTIONS ; do write_value $v >>$ifcfgfile done ;; rawip) test -z "$USERCONTROL" && USERCONTROL=no DEVICETYPE="isdn" DEVICE="${DEVICETYPE}${IDX}" echo -n "Writing ifcfg-${DEVICE} ... " ifcfgfile="../network/ifcfg-${DEVICE}" create_autofile $ifcfgfile /etc/sysconfig/isdn/$ifile ENCAP="rawip" SLAVES="" if [ "$MULTILINK" = "yes" ] ; then test -z "$SLAVECNT" && SLAVECNT=1 while [ $SLAVECNT -gt 0 ]; do test -n "$SLAVES" && SLAVES="${SLAVES} " SLAVES="${SLAVES}${DEVICE}s${SLAVECNT}" SLAVECNT=$(($SLAVECNT - 1)) done fi for v in $IFCFG_OPTIONS $IFCFG_ISDN_OPTIONS ; do write_value $v >>$ifcfgfile done ;; *) echo -n "Protocol $PROTOCOL unknown" ;; esac # handle defaultroute for this device if needed test "$DEMAND" = "yes" || DEFAULTROUTE=no make_defaultroute $DEVICE $DEFAULTROUTE $PTPADDR $NETMASK echo "done" done
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor