#!/bin/sh
#
-# $Id: ip-down,v 1.5 2000/05/07 19:00:00 siefca Exp $
+# $Id: ip-down,v 1.6 2000/06/12 08:38:14 waszi Exp $
# This file should not be modified
#
# This script is run by the pppd _after_ the link is brought down.
# Main Script starts here
-run-parts /etc/sysconfig/interfaces/down.d
+run-parts /etc/sysconfig/interfaces/down.d/ppp
/etc/sysconfig/network-scripts/ifdown-post "${CONFIG}"
#
# description: Allow users to login.
#
-# $Id: allowlogin,v 1.7 1999/12/15 18:41:07 misiek Exp $
+# $Id: allowlogin,v 1.8 2000/06/12 08:38:15 waszi Exp $
# NLS
NLS_DOMAIN="rc-scripts"
# See how we were called.
case "$1" in
start)
- if [ "$DELAY_LOGIN" = "yes" -a -f /etc/nologin.boot ]; then
+ if is_yes "$DELAY_LOGIN" && [ -f /etc/nologin.boot ]; then
run_cmd "Allowing users to login" rm -f /etc/nologin /etc/nologin.boot
fi
;;
stop)
# /etc/nologin when shutting down system
- if [ "$DELAY_LOGIN" = "yes" -a ! -f /etc/nologin ]; then
+ if is_yes "$DELAY_LOGIN" && [ ! -f /etc/nologin ]; then
nls "System shutdown in progress \n" > /etc/nologin
chmod 644 /etc/nologin
cp -fp /etc/nologin /etc/nologin.boot
#
-# $Id: functions.network,v 1.42 2000/04/21 17:43:01 jajcus Exp $
+# $Id: functions.network,v 1.43 2000/06/12 08:38:15 waszi Exp $
#
# This is not a shell script; it provides functions to network scripts
# that source it.
# This will work only after starting interface to which LDAP server is connected
find_ldap_interfaces()
{
-[ "$USE_LDAP" = "yes" -a -x /usr/bin/ldapsearch ] || exit 1
+is_yes "$USE_LDAP" && [ -x /usr/bin/ldapsearch ] || exit 1
if [ -n "$LDAP_BASE_DN" ] ; then
BSWITCH="-b$LDAP_BASE_DN"
else
# find aliases for device
find_ldap_aliases()
{
-[ "$USE_LDAP" = "yes" -a -x /usr/bin/ldapsearch ] || exit 1
+is_yes "$USE_LDAP" && [ -x /usr/bin/ldapsearch ] || exit 1
if [ -n "$LDAP_BASE_DN" ] ; then
BSWITCH="-b$LDAP_BASE_DN"
else
get_ldap_config ()
{
-if [ "$USE_LDAP" = "yes" -a -x /usr/bin/ldapsearch ]; then
+if is_yes "$USE_LDAP" && [ -x /usr/bin/ldapsearch ]; then
exit 1
fi
fi
elif [ -f "/etc/sysconfig/interfaces/$CONFIG" ] ; then
. "/etc/sysconfig/interfaces/$CONFIG"
-elif [ "$USE_LDAP" = "yes" ] ; then
+elif is_yes "$USE_LDAP"; then
eval `get_ldap_config $DEVNAME`
fi
}
# network router discovery daemon
rdisc()
{
-if [ "$IPV6_NETWORKING" = "yes" ]; then
+if is_yes "$IPV6_NETWORKING"; then
[ -z "$IPV6_RDISC_MODE" ] && IPV6_RDISC_MODE=host
- if [ "$IPV6_RDISC" = "on" -o "$IPV6_RDISC" = "yes" ]; then
+ if is_yes "$IPV6_RDISC"; then
RDISC_OPTS="-fs"
case "$1" in
on|start)
if [ -n "$VARD" -a -e /proc/sys/net/$WHAT ]; then
if [ "$TODO" = "start" ]; then
- [ "$VARD" = "no" -a "$SET" = "1" ] && SET="$(($SET - 1))"
- [ "$VARD" = "yes" -a "$SET" = "0" ] && SET="$(($SET + 1))"
+ is_no "$VARD" && [ "$SET" = "1" ] && SET="$(($SET - 1))"
+ is_yes "$VARD" && [ "$SET" = "0" ] && SET="$(($SET + 1))"
if [ -n "$MESSAGE" ]; then
show "`nls "Setting %s to %s" "$MESSAGE" "$SET"`"; busy
if (echo "$SET" > /proc/sys/net/$WHAT) 2> /dev/null; then
*) IPV4_DYNAMIC_IP_PATCH_VALUE=7 ;;
esac
- if [ "$IPV4_DYNAMIC_IP_PATCH" = "yes" -a "$1" = "on" ]; then
+ if is_yes "$IPV4_DYNAMIC_IP_PATCH" && [ "$1" = "on" ]; then
show "Enabling dynamic IP patch"
busy
if echo $IPV4_DYNAMIC_IP_PATCH_VALUE > /proc/sys/net/ipv4/ip_dynaddr; then
{
if [ "$IPV4_LOCAL_PORT_RANGE" != "default" -a -n "$IPV4_LOCAL_PORT_RANGE" ] || \
[ ! -e /proc/sys/net/ipv4/ip_local_port_range ]; then
- if [ "$IPV4_LOCAL_PORT_RANGE" = "yes" -a "$1" = "on" ]; then
+ if is_yes "$IPV4_LOCAL_PORT_RANGE" && [ "$1" = "on" ]; then
show "Setting local port range"; busy
if echo "$IPV4_LOCAL_PORT_RANGE" > /proc/sys/net/ipv4/ip_local_port_range; then
deltext
{
if [ "$IPV4_ANTI_SPOOFING" != "default" -a -n "$IPV4_ANTI_SPOOFING" ] || \
[ ! -e /proc/sys/net/ipv4/conf/all/rp_filter ]; then
- if [ "$IPV4_ANTI_SPOOFING" = "yes" -a "$1" = "on" ]; then
+ if is_yes "$IPV4_ANTI_SPOOFING" && [ "$1" = "on" ]; then
show "Setting up IP spoofing protection"; busy
if (for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 1 > $f; done); then
deltext
static_arp()
{
-if [ "$STATIC_ARP" = "yes" ]; then
+if is_yes "$STATIC_ARP"; then
if [ -r /etc/ethers -a -x /sbin/arp ]; then
/sbin/arp -f /etc/ethers
fi
modprobe_net()
{
-if [ "$IPV6_NETWORKING" = "yes" -a \
- "`ls -R /lib/modules/\`uname -r\`/ | grep ipv6.o`" != "" ]; then
+if is_yes "$IPV6_NETWORKING" && [ "`ls -R /lib/modules/\`uname -r\`/ | grep ipv6.o`" != "" ]; then
modprobe -s -k net-pf-10
fi
}
#
# probe: true
-# $Id: network,v 1.33 2000/04/03 14:50:46 baggins Exp $
+# $Id: network,v 1.34 2000/06/12 08:38:15 waszi Exp $
# NLS
NLS_DOMAIN="rc-scripts"
. /etc/sysconfig/network
# Check that networking is up.
-[ "${NETWORKING}" = "no" -o "${NETWORKING}" = "" ] && exit 0
+is_no "${NETWORKING}" && exit 0
[ -x /sbin/ip ] || exit 0
setup_routes on
# Setup IPX
-case "$IPX" in
- yes|true)
+if is_yes "$IPX"; then
if [ ! -z $IPXAUTOPRIMARY ] ; then
- /usr/bin/ipx_configure --auto_primary=$IPXAUTOPRIMARY
+ /usr/bin/ipx_configure --auto_primary=$IPXAUTOPRIMARY
fi
if [ ! -z $IPXAUTOFRAME ] ; then
- /usr/bin/ipx_configure --auto_interface=$IPXAUTOFRAME
+ /usr/bin/ipx_configure --auto_interface=$IPXAUTOFRAME
fi
if [ ! -z "$IPXINTERNALNETNUM" -a "$IPXINTERNALNETNUM" != "0" ]; then
- /usr/bin/ipx_internal_net add $IPXINTERNALNETNUM $IPXINTERNALNODENUM
+ /usr/bin/ipx_internal_net add $IPXINTERNALNETNUM $IPXINTERNALNODENUM
fi
- ;;
- *)
- ;;
-esac
+fi
}
network_postinit()
# IPv4 forwarding
proc_net ipv4/ip_forward $TODO 1 0 IPV4_FORWARDING "IPv4 forwarding"
# IPv6 forwarding
-if [ "$IPV6_NETWORKING" = "yes" ]; then
+if is_yes "$IPV6_NETWORKING"; then
proc_net ipv6/conf/all/forwarding $TODO 1 0 IPV6_FORWARDING "IPv6 forwarding"
fi
# Others proc/net
#!/bin/sh
#
# /etc/rc.d/rc.sysinit - run once at boot time
-# $Id: rc.sysinit,v 1.64 2000/06/02 10:00:12 zagrodzki Exp $
+# $Id: rc.sysinit,v 1.65 2000/06/12 08:38:14 waszi Exp $
#
# Taken in part from Miquel van Smoorenburg's bcheckrc.
# Changes: Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
# set up pnp
if [ -x /sbin/isapnp -a -f /etc/isapnp/isapnp.conf ]; then
- if [ -n "$PNP" -a "$RUN_ISAPNP" = "yes" ]; then
+ if [ -n "$PNP" ] && is_yes "$RUN_ISAPNP"; then
run_cmd "Setting up ISA PNP devices" /sbin/isapnp /etc/isapnp/isapnp.conf
fi
fi
# /etc/nologin when starting system
[ -f /etc/nologin.boot ] && rm -f /etc/nologin /etc/nologin.boot
-if [ "$DELAY_LOGIN" = "yes" -a ! -f /etc/nologin ]; then
+if is_yes "$DELAY_LOGIN" && [ ! -f /etc/nologin ]; then
show "Enabling Delay Login"; busy
echo > /etc/nologin
nls "System bootup in progress - please wait" >> /etc/nologin
fi
# load sound modules
-if [ -n "$USEMODULES" -a "$LOAD_SOUND" = "yes" ]; then
+if [ -n "$USEMODULES" ] && is_yes "$LOAD_SOUND"; then
if grep -s -q "^alias sound-slot-0" /etc/modules.conf ; then
run_cmd "Loading sound module" modprobe -s sound-slot-0
fi
#!/bin/sh
#
-# $Id: ifdown-sl,v 1.9 1999/10/13 21:28:40 kloczek Exp $
+# $Id: ifdown-sl,v 1.10 2000/06/12 08:38:15 waszi Exp $
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
rm -f /var/run/sl-$DEVICE.dev
# we can use dip or direct slip connection via slattach
-if [ "$DIRECT_CONNECT" != "yes" ]; then
+if is_no "$DIRECT_CONNECT"; then
PID=`pidof dip-$DEVICE`
else
PID=`pidof slattach`
#!/bin/sh
#
-# $Id: ifup,v 1.41 2000/05/29 19:37:06 baggins Exp $
+# $Id: ifup,v 1.42 2000/06/12 08:38:15 waszi Exp $
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
source_config
-if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" ]; then
+if [ "foo$2" = "fooboot" ] && is_no "${ONBOOT}"; then
exit
fi
fi
# Old BOOTP variable
-if [ "$BOOTP" = "yes" ]; then
+if is_yes "$BOOTP"; then
BOOTPROTO=bootp
fi
NETMASK="`calcnetmask $PREFIX`"
fi
-[ "$MULTICAST" = "yes" ] && MULTICAST=on || MULTICAST=off
+is_yes "$MULTICAST" && MULTICAST=on || MULTICAST=off
[ -n "$SRC_ADDR" ] && SRC_ADDR="src ${SRC_ADDR}" || SRC_ADDR=""
[ -n "$SCOPE" ] && SCOPE="scope ${SCOPE}" || SCOPE=""
if [ "$ARP" ]; then
- [ "$ARP" = "yes" ] && ARP=on || ARP=off
+ is_yes "$ARP" && ARP=on || ARP=off
elif [ "$DEVICETYPE" = "eth" ]; then
ARP=on
else
# IPv6 rules
- if [ "${IPV6_NETWORKING}" = "yes" ] ; then
+ if is_yes "${IPV6_NETWORKING}"; then
for ADDR6 in ${IPV6_ADDR} ; do
ip -family inet6 addr add ${ADDR6} dev ${DEVICE} label ${FULLDEVNAME}
fi
fi
-if [ "$IPX" = "yes" ]; then
+if is_yes "$IPX"; then
/etc/sysconfig/network-scripts/ifup-ipx $DEVICE
fi
#!/bin/sh
#
-# $Id: ifup-aliases,v 1.9 1999/10/13 21:28:40 kloczek Exp $
+# $Id: ifup-aliases,v 1.10 2000/06/12 08:38:15 waszi Exp $
#
# adds aliases of device $1
. /etc/sysconfig/network
+. /etc/rc.d/init.d/functions
. /etc/sysconfig/network-scripts/.functions
if [ "$1" = "" ]; then
#!/bin/sh
#
-# $Id: ifup-plip,v 1.9 1999/10/13 21:28:40 kloczek Exp $
+# $Id: ifup-plip,v 1.10 2000/06/12 08:38:15 waszi Exp $
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
CONFIG=$1
source_config
-if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" ]
-then
+if [ "foo$2" = "fooboot" ] && is_no "${ONBOOT}"; then
exit
fi
#!/bin/sh
#
-# $Id: ifup-post,v 1.20 2000/04/21 17:45:24 jajcus Exp $
+# $Id: ifup-post,v 1.21 2000/06/12 08:38:15 waszi Exp $
#
run_up() { :; }
+. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
. /etc/sysconfig/network-scripts/.functions
#!/bin/sh
#
-# $Id: ifup-ppp,v 1.12 2000/04/23 11:46:04 marcus Exp $
+# $Id: ifup-ppp,v 1.13 2000/06/12 08:38:15 waszi Exp $
#
# ifup-ppp script for pppd-2.3.5 (with persist & demand options) ver 0.2
# Grzegorz Stanislawski <stangrze@open.net.pl>
source_config
[ -z "$HOLDOFF" ] && HOLDOFF=30
-if [ "$2" = "boot" -a "${ONBOOT}" = "no" ]; then
+if [ "$2" = "boot" ] && is_no "${ONBOOT}"; then
exit
fi
[ -x /usr/sbin/pppd ] || {
}
opts="lock"
-if [ "${PERSIST}" = "yes" ]; then
+if is_yes "${PERSIST}"; then
if [ -z "${MAXFAIL}" ]; then
MAXFAIL="0"
fi
opts="$opts persist holdoff $HOLDOFF maxfail $MAXFAIL"
fi
-if [ "${DEMAND}" = "yes" ]; then
+if is_yes "${DEMAND}"; then
if [ -z "${IDLE}" ]; then
IDLE="0"
fi
opts="$opts demand idle ${IDLE}"
fi
-if [ "${HARDFLOWCTL}" = yes ] ; then
+if is_yes "${HARDFLOWCTL}"; then
opts="$opts modem crtscts"
fi
-if [ "${ESCAPECHARS}" = yes ] ; then
+if is_yes "${ESCAPECHARS}"; then
opts="$opts asyncmap FFFFFFFF"
elif [ "${ESCAPECHARS}" = no ] ; then
opts="$opts asyncmap 00000000"
fi
-if [ "${DEFROUTE}" = yes ] ; then
+if is_yes "${DEFROUTE}" = yes; then
opts="$opts defaultroute"
fi
if [ -n "${MRU}" ] ; then
if [ -n "${REMOTENAME}" ] ; then
opts="$opts remotename ${REMOTENAME}"
fi
-if [ "${DEBUG}" = yes ] ; then
+if is_yes "${DEBUG}"; then
opts="$opts debug"
chatdbg="-v"
fi
#!/bin/sh
#
-# $Id: ifup-sl,v 1.15 1999/10/13 21:28:40 kloczek Exp $
+# $Id: ifup-sl,v 1.16 2000/06/12 08:38:15 waszi Exp $
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
CONFIG=$1
source_config
-if [ "foo$2" = "fooboot" -a ${ONBOOT} = "no" ]
-then
+if [ "foo$2" = "fooboot" ] && is_no ${ONBOOT}; then
exit
fi
fi
# we can use dip or direct slip connection via slattach
-if [ "$DIRECT_CONNECT" != "yes" ]; then
+if is_no "$DIRECT_CONNECT"; then
[ -x /usr/sbin/dip ] || {
nls "/usr/sbin/dip does not exist or is not executable"
(logger -p daemon.info -t ifup-sl \
"`nls 'dip started for'` $DEVICE `nls 'on'` $MODEMPORT `nls 'at'` $LINESPEED" &)&
doexec /usr/sbin/dip dip-$DEVICE $DIPSCRIPT
- if [ "$PERSIST" != "yes" -o ! -f /var/run/sl-$DEVICE.dev ] ; then
+ if is_no "$PERSIST" || [ ! -f /var/run/sl-$DEVICE.dev ] ; then
exit 0
fi
rm -f /var/run/sl-$DEVICE.dev
ip -family inet addr add $IPADDR peer $REMIP dev $DEVICE
# Set defaultroute
- if [ "$DEFROUTE" = "yes" ]; then
+ if is_yes "$DEFROUTE"; then
ip -family inet route add default dev $DEVICE
fi
#!/bin/sh
#
-# $Id: tnldown,v 1.14 2000/03/31 13:10:22 misiek Exp $
+# $Id: tnldown,v 1.15 2000/06/12 08:38:15 waszi Exp $
#
# Author: Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
#
source_config
-[ "${IPV6_TUNNELCONFIG}" != "yes" -a "${MODE}" = "sit" ] && exit 0
-[ "${IPX}" != "yes" -a "${MODE}" = "ipxip" ] && exit 0
-[ "${IPX}" != "yes" -a "${MODE}" = "ipipx" ] && exit 0
+is_no "${IPV6_TUNNELCONFIG}" && [ "${MODE}" = "sit" ] && exit 0
+is_no "${IPX}" && [ "${MODE}" = "ipxip" ] && exit 0
+is_no "${IPX}" && [ "${MODE}" = "ipipx" ] && exit 0
if [ "${MODE}" = "ipip" ] || [ "${MODE}" = "sit" ] || [ "${MODE}" = "gre" ]; then
#!/bin/sh
#
-# $Id: tnlup,v 1.17 2000/03/31 13:10:22 misiek Exp $
+# $Id: tnlup,v 1.18 2000/06/12 08:38:15 waszi Exp $
#
# Author: Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
#
source_config
-if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" ]
-then
+if [ "foo$2" = "fooboot" ] && is_no "${ONBOOT}"; then
exit
fi
-[ "${IPV6_TUNNELCONFIG}" != "yes" -a "${MODE}" = "sit" ] && exit 0
-[ "${IPX}" != "yes" -a "${MODE}" = "ipxip" ] && exit 0
-[ "${IPX}" != "yes" -a "${MODE}" = "ipipx" ] && exit 0
+is_no "${IPV6_TUNNELCONFIG}" && [ "${MODE}" = "sit" ] && exit 0
+is_no "${IPX}" && [ "${MODE}" = "ipxip" ] && exit 0
+is_no "${IPX}" && [ "${MODE}" = "ipipx" ] && exit 0
if [ "${MODE}" = "gre" -a "`ls -R /lib/modules/\`uname -r\`/ | grep ip_gre.o`" != "" ]; then
modprobe -s -k ip_gre
[ -n "${TOS}" ] && TOS="tos ${TOS}"
[ -n "${BIND_DEV}" ] && BIND_DEV="dev ${BIND_DEV}"
-if [ "${SEQ}" = "yes" ]; then
+if is_yes "${SEQ}"; then
SEQ=seq
else
- [ "${ISEQ}" = "yes" ] && SEQ=iseq
- [ "${OSEQ}" = "yes" ] && SEQ="${SEQ} oseq"
+ is_yes "${ISEQ}" && SEQ=iseq
+ is_yes "${OSEQ}" && SEQ="${SEQ} oseq"
fi
-if [ "${CSUM}" = "yes" ]; then
+if is_yes "${CSUM}"; then
CSUM=csum
else
- [ "${ICSUM}" = "yes" ] && CSUM=icsum
- [ "${ICSUM}" = "yes" ] && CSUM="${SEQ} ocsum"
+ is_yes "${ICSUM}" && CSUM=icsum
+ is_yes "${ICSUM}" && CSUM="${SEQ} ocsum"
fi
-[ "${ISEQ}" = "yes" ] && ISEQ=iseq
-[ "${ISEQ}" = "yes" ] && ISEQ=iseq
-[ "${ISEQ}" = "yes" ] && ISEQ=iseq
-[ "${ISEQ}" = "yes" ] && ISEQ=iseq
+is_yes "${ISEQ}" && ISEQ=iseq
+is_yes "${ISEQ}" && ISEQ=iseq
+is_yes "${ISEQ}" && ISEQ=iseq
+is_yes "${ISEQ}" && ISEQ=iseq
[ "${TTL}" != "0" -a "${TTL}" != "inherit" ] && PMTUDISC=yes
-if [ "${PMTUDISC}" = "yes" ]; then
+if is_yes "${PMTUDISC}"; then
PMTUDISC=pmtudisc
-elif [ "${PMTUDISC}" = "no" ]; then
+elif is_no "${PMTUDISC}"; then
PMTUDISC=nopmtudisc
fi