- dodano ifup-tnl && ifdown-tnl - obsługa tuneli ipip, sit, gre (ipxip niezrobiona jeszcze)
- tunnels-ip6.conf - zbędne (tunele są konfigurowane w stylu SySV)
- drobne poprawki
svn-id: @378
echo "*** Dropping you to a shell; the system will reboot"
echo "*** when you leave the shell."
- PS1="(Repair filesystem) \#"; export PS1
- if [ "$RUN_SULOGIN_ON_ERR" = "yes"]; then
+ PS1='(Repair filesystem) #'; export PS1
+ if [ "$RUN_SULOGIN_ON_ERR" == "yes" ]; then
sulogin
else
/bin/sh
run_cmd "Unmounting file systems" umount -a
mount -n -o remount,ro /
run_cmd "Automatic reboot in progress." reboot
- elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
+ elif [ "$rc" == "1" -a -x /sbin/quotacheck ]; then
_RUN_QUOTACHECK=1
fi
fi
run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
# Update quotas if fsck was run on /.
-if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then
+if [ X"$_RUN_QUOTACHECK" == "X1" -a -x /sbin/quotacheck ]; then
run_cmd "Checking root filesystem quotas" /sbin/quotacheck -v /
fi
echo "*** Dropping you to a shell; the system will reboot"
echo "*** when you leave the shell."
- PS1="(RAID Repair) \#"; export PS1
- if [ "$RUN_SULOGIN_ON_ERR" == "yes"]; then
+ PS1='(RAID Repair) #'; export PS1
+ if [ "$RUN_SULOGIN_ON_ERR" == "yes" ]; then
sulogin
else
/bin/sh
echo "*** Dropping you to a shell; the system will reboot"
echo "*** when you leave the shell."
- PS1="(Repair filesystem) \#"; export PS1
- if [ "$RUN_SULOGIN_ON_ERR" = "yes"]; then
+ PS1='(Repair filesystem) #'; export PS1
+ if [ "$RUN_SULOGIN_ON_ERR" == "yes" ]; then
sulogin
else
/bin/sh
run_cmd "Unmounting file systems" umount -a
run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
run_cmd "Automatic reboot in progress." reboot
- elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
+ elif [ "$rc" == "1" -a -x /sbin/quotacheck ]; then
run_cmd "Checking filesystem quotas"/sbin/quotacheck -v -R -a
fi
fi
. /etc/sysconfig/clock
# convert old style clock config to new values
- if [ "${CLOCKMODE}" = "GMT" ]; then
+ if [ "${CLOCKMODE}" == "GMT" ]; then
UTC=true
- elif [ "${CLOCKMODE}" = "ARC" ]; then
+ elif [ "${CLOCKMODE}" == "ARC" ]; then
ARC=true
fi
fi
REMOTEADDR=<IPv4 addres>
[ LOCALADDR=<IPv4 addres> ]
- [ REALDEVICE=<name of physic device>
+ [ BIND_DEV= ] do jakiego device przybindowaæ (ma zwi±zek z routingiem itp)
+
[ TTL= ]
[ TOS= ]
[ SEQ={no|yes} ]
[ CSUM={no|yes} ]
[ ICSUM={no|yes} ]
[ OCSUM={no|yes} ]
- [ NOPMTUDISC={no|yes} ]
+ [ PMTUDISC={no|yes} ]
fi
ISALIAS=no
fi
-if [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then
- if [ -f /var/run/dhcpcd-${DEVICE}.pid ]; then
- kill `cat /var/run/dhcpcd-${DEVICE}.pid`
- rm -f /var/run/dhcpcd-${DEVICE}.pid
- exit 0
- fi
- exit 1
-fi
-
#ifconfig ${DEVICE} down
ip link set ${DEVICE} down
-#!/bin/bash
+#!/bin/sh
# This should be called whenever an interface goes down, not just when
# it is brought down explicitly.
# pppd might have chat as a child; remember chat's pid to kill after pppd.
# (After, not before, so that pppd doesn't just restart it).
-CHATPID=`ps axl | awk '$4 ~ $PID {print $3}' 2>/dev/null`
+CHATPID=`ps axl | awk '$4 ~ /^'"$PID"'$/ {print $3}' 2>/dev/null`
kill $PID > /dev/null 2>&1
[ -n "$CHATPID" ] && kill $CHATPID > /dev/null 2>&1
--- /dev/null
+#!/bin/sh
+#
+# Author: Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
+#
+# Uwagi:
+# - przy dodawaniu routingu w ifup pamiêtac o "onlink" (patrz dokumentacja do iproute)
+# - gdzie¶ trzeba umie¶ciæ modprobe ipip && modprobe ip_gre
+#
+
+cd /etc/sysconfig/network-scripts
+. /etc/rc.d/init.d/functions.network
+
+CONFIG=$1
+source_config
+
+if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" ]
+then
+ exit
+fi
+
+if [ "${MODE}" == "ipip" ] || [ "${MODE}" == "sit" ] || [ "${MODE}" == "gre" ]; then
+
+ ip tunnel del ${DEVICE}
+
+elif [ "${MODE}" == "ipxip" ] || [ "${MODE}" == "ipipx" ]; then
+
+echo "obs³uga ipxip jeszcze nie zrobiona"
+
+fi
BOOTPROTO=bootp
fi
+if [ "$BOOTPROTO" = bootp -o "$BOOTPROTO" = dhcp ]; then
+ PUMP=true
+fi
+
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-${DEVICETYPE}"
if [ -x $OTHERSCRIPT ]; then
fi
# is this device available? (this catches PCMCIA devices for us)
-/sbin/ifconfig ${REALDEVICE} 2>&1 | grep -s "unknown interface" > /dev/null
+/sbin/ifconfig ${REALDEVICE} 2>&1 | grep -s "not found" > /dev/null
if [ "$?" = "0" ]; then
echo "Delaying ${DEVICE} initialization."
exit 0
ifconfig ${DEVICE} down
echo "Enslaving $DEVICE to $MASTER"
- ifenslave $RFLAG "$DEVICE" "$MASTER"
+ ifenslave $RFLAG "$MASTER" "$DEVICE"
exit 0
fi
-if [ "$BOOTPROTO" = bootp -a "$ISALIAS" = no ]; then
-# ifconfig ${DEVICE} down
- ip link set ${DEVICE} down
-# ifconfig ${DEVICE} 0.0.0.0 broadcast 255.255.255.255 netmask 0.0.0.0
- ip addr add 0.0.0.0/0 broadcast 255.255.255.255 dev ${DEVICE}
-# route add default ${DEVICE}
- ip route add 0.0.0.0/0 dev ${DEVICE}
- echo "Sending bootp request"
- TMPFILE=`/bin/mktemp /tmp/bootp-${DEVICE}.XXXXXX` || {
-# ifconfig ${DEVICE} down
- ip link set ${DEVICE} down
- echo 'mktemp failed'
- exit 1
- }
- bootpc --returniffail --timeoutwait 6 --dev ${DEVICE} 2>/dev/null > ${TMPFILE}
- if [ "$?" = "0" ]; then
- . ${TMPFILE}
- BOOTPHOSTNAME="$HOSTNAME"
- echo "bootp response received -- using IP ${IPADDR}"
- elif [ -z "$IPADDR" ]; then
-# ifconfig ${DEVICE} down
- ip link set ${DEVICE} down
- echo "No bootp response recieved -- not configuring device ${DEVICE}."
- rm -f ${TMPFILE}
- exit 1
- else
- echo "No bootp response recieved -- using default configuration for device ${DEVICE}."
- fi
-
- rm -f ${TMPFILE}
-elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then
- echo -n "Using DHCP for ${DEVICE}... "
- IFNAME=${DEVICE} \
- /sbin/dhcpcd -c /etc/sysconfig/network-scripts/ifdhcpc-done ${DEVICE}
- echo "echo \$$ > /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh
+if [ -n "$MACADDR" ]; then
+ ifconfig ${DEVICE} hw ether ${MACADDR}
+fi
- if [ -f /var/run/dhcp-wait-${DEVICE}.pid ]; then
- echo "failed."
- exit 1
+if [ -n "$PUMP" ]; then
+ echo -n "Determining IP information for $DEVICE..."
+ if /sbin/pump -i $DEVICE ; then
+ echo " done."
else
- rm -f /var/run/dhcp-wait-${DEVICE}.pid
- echo "done."
- IPSETUP=yes
+ echo " failed."
+ exit 1
fi
-fi
+
+else
if [ "$IPSETUP" != yes ]; then
if [ -z "$NETMASK" ]; then
eval `/bin/ipcalc --network ${IPADDR} ${NETMASK}`
fi
- ifconfig ${DEVICE} ${MACADDR:+hw ether $MACADDR} ${IPADDR} \
- netmask ${NETMASK} broadcast ${BROADCAST}
+ ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
if [ "${IP6VNETWORKING}" = "yes" ] ; then
for ADDR in ${IP6VADDRS} ; do
ip addr add ${ADDR} dev ${DEVICE}
done
fi
-
- if [ "$ISALIAS" = no ] ; then
+
+# hack for 2.2 kernels
+ if [ "$ISALIAS" = no ] && [ -z "`route -n | sed "s/ .*//" | grep ${NETWORK}`" ]; then
# potrzebna zamiana netmaski z postaci np. 255.255.255.255 -> 32
route add -net ${NETWORK} netmask ${NETMASK} ${DEVICE}
else
[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
source_config
-for frametype in 802_2 802_3 ETHERII SNAP ; do
+for frametype in 802.2 802.3 ETHERII SNAP ; do
# Yes, this kind of evaluation is really necessary to do this.
# Welcome to shell programming... No, we were not smoking some
# particularly good floppies while we wrote this. :-)
- case $(eval echo $(echo \$`echo IPXACTIVE_$frametype`)) in
+ framename=$(echo $frametype | sed 's/\./_/')
+ case $(eval echo $(echo \$`echo IPXACTIVE_$framename`)) in
yes|true)
- case $(eval echo $(echo \$`echo IPXPRIMARY_$frametype`)) in
+ case $(eval echo $(echo \$`echo IPXPRIMARY_$framename`)) in
yes|true) primary=-p ;;
*) primary= ;;
esac
/usr/bin/ipx_interface add $1 $primary $frametype \
- $(eval echo $(echo \$`echo IPXNETNUM_$frametype`))
+ $(eval echo $(echo \$`echo IPXNETNUM_$framename`))
;;
esac
done
/etc/sysconfig/network-scripts/ifup-aliases ${DEVICE}
fi
-if [ -n "$NEEDHOSTNAME" -a ${DEVICE} != lo ]; then
+# don't set hostname on ppp/slip connections
+if [ -n "$NEEDHOSTNAME" -a "${DEVICE}" != lo -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then
# przy zastêpowaniu ifconfiga iproutem trzeba uwa¿aæ na aliasy eth0:1
IPADDR=`ifconfig ${DEVICE} | grep 'inet addr' |
awk -F: '{ print $2 } ' | awk '{ print $1 }'`
if [ "$1" != daemon ] ; then
# disconnect stdin, out, err to disassociate from controlling tty
# so that no HUPs will get through.
- $0 daemon $*& </dev/null >/dev/null 2>/dev/null
+ $0 daemon $* </dev/null >/dev/null 2>/dev/null &
exit 0
fi
shift
opts="$opts modem crtscts"
fi
if [ "${ESCAPECHARS}" = yes ] ; then
+ opts="$opts asyncmap FFFFFFFF"
+elif [ "${ESCAPECHARS}" = no ] ; then
opts="$opts asyncmap 00000000"
fi
if [ "${DEFROUTE}" = yes ] ; then
# Check if slattach (or other process) is using $MODEMPORT
# if not - execute slattach
- if fuser -s $MODEMPORT; then
+ if [ -x /usr/sbin/fuser ] && fuser -s $MODEMPORT; then
logger -p daemon.info -t ifup-sl "some process is currently using $MODEMPORT"
+ echo "some process is currently using $MODEMPORT - aborting..."
else
slattach -p $PROTOCOL -s $LINESPEED $MODEMPORT &
usleep 500
--- /dev/null
+#!/bin/sh
+#
+# Author: Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
+#
+# Uwagi:
+# - przy dodawaniu routingu w ifup pamiêtac o "onlink" (patrz dokumentacja do iproute)
+# - gdzie¶ trzeba umie¶ciæ modprobe ipip && modprobe ip_gre
+#
+
+cd /etc/sysconfig/network-scripts
+. /etc/rc.d/init.d/functions.network
+
+CONFIG=$1
+source_config
+
+if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" ]
+then
+ exit
+fi
+
+[ -z "${TTL}" ] && TTL=inherit
+[ -z "${TOS}" ] && TOS=inherit
+[ -z "${LOCALADDR}" ] && LOCALADDR=any
+[ -z "${REMOTEADDR}" ] && REMOTEADDR=any
+[ -n "${BIND_DEV}" ] && BIND_DEV="dev $BIND_DEV"
+
+if [ "${SEQ}" == "yes" ]; then
+ SEQ=seq
+else
+ [ "${ISEQ}" == "yes" ] && SEQ=iseq
+ [ "${OSEQ}" == "yes" ] && SEQ="$SEQ oseq"
+fi
+
+if [ "${CSUM}" == "yes" ]; then
+ CSUM=csum
+else
+ [ "${ICSUM}" == "yes" ] && CSUM=icsum
+ [ "${ICSUM}" == "yes" ] && CSUM="$SEQ ocsum"
+fi
+
+[ "${ISEQ}" == "yes" ] && ISEQ=iseq
+[ "${ISEQ}" == "yes" ] && ISEQ=iseq
+[ "${ISEQ}" == "yes" ] && ISEQ=iseq
+[ "${ISEQ}" == "yes" ] && ISEQ=iseq
+
+[ "${TTL}" != "0" -a "${TTL}" != "inherit" ] && PMTUDISC=yes
+
+if [ "${PMTUDISC}" == "yes" ]; then
+ PMTUDISC=pmtudisc
+else
+ PMTUDISC=nopmtudisc
+fi
+
+if [ -n "${KEY}" ]; then
+IKEY=""
+OKEY=""
+fi
+
+if [ "${MODE}" == "ipip" ] || [ "${MODE}" == "sit" ]; then
+
+ ip tunnel add ${DEVICE} mode ${MODE} local ${LOCALADDR} remote ${REMOTEADDR} ttl ${TTL} tos ${TOS} ${PMTUDISC} $BIND_DEV
+
+elif [ "${MODE}" == "gre" ]; then
+
+ ip tunnel add ${DEVICE} mode ${MODE} local ${LOCALADDR} remote ${REMOTEADDR} ttl ${TTL} tos
+${TOS} ${PMTUDISC} $BIND_DEV $CSUM $ISEQ ${KEY} ${IKEY} ${OKEY}
+
+elif [ "${MODE}" == "ipxip" ] || [ "${MODE}" == "ipipx" ]; then
+
+echo "obs³uga ipxip jeszcze nie zrobiona"
+
+fi
+++ /dev/null
-#!F:tunnels-ip6.conf
-#
-#!P:/etc/sysconfig
-#
-#!S:root:root 440
-#
-#!D:IPv6 configuration file
-#
-#!C:Copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
-#!C:changes (versions X.XXa) by Grzegorz Stanislawski <stangrze@open.net.pl>
-#
-#!V:Version 2.12a 10.11.1998
-
-# Changes to
-# 2.11: nothing important
-# 2.12: NBMA tunnel configuration ready
-# 2.12a:
-# - this file contains data which was moved from network-ip6.conf
-# - Support for verbose interface names (see network-ip6.conf for info)
-# - removed nbma suppport (since i cannot imagine what is this for - (stangrze))
-# This file is needed by 'functions-ip6' version 2.41a
-
-### The order in the file is only for a good overview, it is not really
-### necessary. The important values are 'device' and 'key'!
-
-
-################# Tunnel section
-
-## Here you can configure tunnel endpoints. Be sure, that you set the device
-## entry in a right way like 'sit1', 'sit2' and so on, otherwise you will get
-## an error information from 'functions-ip6'
-
-#Device Key local remote ttl realdev
-icm-pl tunnel 195.136.100.3 193.219.28.246 64 eth0
-ceti tunnel 195.136.100.3 195.116.211.16 64 eth0
-ckm tunnel 195.136.100.3 195.136.5.6 64 eth0
-wiget tunnel 195.136.100.3 156.17.210.110 64 eth0
-#sit2 tunnel IPv4-Address
-#sit3 tunnel IPv4-Address
-
-
-# Tunnel route section
-# Here you can specify several routes to your configured tunnels.
-# More than one are possible!
-
-#Device Key Network
-icm-pl route 3ffe:902::/32
-ceti route 3ffe:902:3::/48
-ckm route 3ffe:902:10::1:0/112
-wiget route 3ffe:902:11::/48
-#sit2 route IPv6-Network/Prefix
-#sit3 route IPv6-Network/Prefix
-