SHA256
1
0
forked from pool/dhcp
dhcp/dhcp-3.1.3-dhclient-script.bnc555095.dif
Stephan Kulow 9f076708f3 Accepting request 28414 from home:jengelh:branches:network:dhcp
Copy from home:jengelh:branches:network:dhcp/dhcp via accept of submit request 28414 revision 3.
Request was accepted with message:
Reviewed ok

OBS-URL: https://build.opensuse.org/request/show/28414
OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=6
2010-01-11 10:05:04 +00:00

74 lines
3.1 KiB
Plaintext

--- client/scripts/linux
+++ client/scripts/linux 2009/12/14 22:29:11
@@ -28,7 +28,11 @@
# logs entire run of dhclient-script to /var/log/dhclient-script,
# if DHCLIENT_DEBUG is set in sysconfig/network/dhcp
#
-eval `grep "^DHCLIENT_DEBUG=" /etc/sysconfig/network/dhcp 2>/dev/null`
+SYSCONFIG_CFG_DIR="/etc/sysconfig/network"
+SYSCONFIG_RUN_DIR=`. "$SYSCONFIG_CFG_DIR/scripts/functions" \
+ 2>/dev/null && echo "$RUN_FILES_BASE"`
+SYSCONFIG_RUN_DIR=${SYSCONFIG_RUN_DIR:-/dev/.sysconfig/network}
+eval `grep "^DHCLIENT_DEBUG=" "$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
if [ "$DHCLIENT_DEBUG" = yes ]; then
set -a # allexport
(
@@ -90,21 +94,21 @@ netconfig_remove() {
}
set_default_gw_route()
{
- if test -f /etc/sysconfig/network/ifcfg-${interface} -o \
- -f /dev/shm/sysconfig/if-${interface} ;
+ if test -f "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" -o \
+ -f "$SYSCONFIG_RUN_DIR/if-${interface}" ;
then
- if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
+ if grep -qs '^primary=yes' "$SYSCONFIG_RUN_DIR/if-${interface}" 2>/dev/null ;
then
eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
- /etc/sysconfig/network/dhcp
- /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
+ "$SYSCONFIG_CFG_DIR/dhcp"
+ "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
else
eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
- /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
+ "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
fi
else
eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
- /etc/sysconfig/network/dhcp 2>/dev/null`
+ "$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
fi
if [ "$DHCLIENT_SET_DEFAULT_ROUTE" = yes ] ; then
for router in $new_routers; do
@@ -130,21 +134,21 @@ set_default_gw_route()
}
set_hostname()
{
- if test -f /etc/sysconfig/network/ifcfg-${interface} -o \
- -f /dev/shm/sysconfig/if-${interface} ;
+ if test -f "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" -o \
+ -f "$SYSCONFIG_RUN_DIR/if-${interface}" ;
then
- if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
+ if grep -qs '^primary=yes' "$SYSCONFIG_RUN_DIR/if-${interface}" 2>/dev/null ;
then
eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
- /etc/sysconfig/network/dhcp
- /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
+ "$SYSCONFIG_CFG_DIR/dhcp"
+ "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
else
eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
- /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
+ "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
fi
else
eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
- /etc/sysconfig/network/dhcp 2>/dev/null`
+ "$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
fi
if [ "$DHCLIENT_SET_HOSTNAME" = yes ] ; then
current_hostname=`hostname`