source: bootscripts/contrib/lsb-v3/sbin/ifup@ cb95d5f

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since cb95d5f was cb95d5f, checked in by DJ Lucas <dj@…>, 13 years ago

Changed distribution directory structure.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9530 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.9 KB
Line 
1#!/bin/sh
2########################################################################
3# Begin $NETWORK_DEVICES/ifup
4#
5# Description : Interface Up
6#
7# Authors : Nathan Coulson - nathan@linuxfromscratch.org
8# Kevin P. Fleming - kpfleming@linuxfromscratch.org
9#
10# Version : 00.00
11#
12# Notes : the IFCONFIG variable is passed to the scripts found
13# in the services directory, to indicate what file the
14# service should source to get environmental variables.
15#
16########################################################################
17
18. /lib/lsb/init-functions
19
20# Collect a list of configuration files for our interface
21if [ -n "${2}" ]; then
22 for file in ${@#$1} # All parameters except $1
23 do
24 FILES="${FILES} ${NETWORK_DEVICES}/ifconfig.${1}/${file}"
25 done
26elif [ -d "${NETWORK_DEVICES}/ifconfig.${1}" ]; then
27 FILES=`echo ${NETWORK_DEVICES}/ifconfig.${1}/*`
28else
29 FILES="${NETWORK_DEVICES}/ifconfig.${1}"
30fi
31
32message="Bringing up the ${1} interface..."
33
34# Process each configruation file
35for file in ${FILES}; do
36 # skip backup files
37 if [ "${file}" != "${file%""~""}" ]; then
38 continue
39 fi
40
41 if [ ! -f "${file}" ]; then
42 log_warning_msg
43 message="${file} is not a network configuration file or directory."
44 log_warning_msg
45 fi
46
47 (
48 . ${file}
49
50 # Will not process this service if started by boot, and ONBOOT
51 # is not set to yes
52 if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then
53 continue
54 fi
55 # Will not process this service if started by hotplug, and
56 # ONHOTPLUG is not set to yes
57 if [ "${IN_HOTPLUG}" = "1" -a "${ONHOTPLUG}" != "yes" -a "${HOSTNAME}" != "(none)" ]; then
58 continue
59 fi
60
61 if [ -n "${SERVICE}" -a -x "${NETWORK_DEVICES}/services/${SERVICE}" ]; then
62 if [ -z "${CHECK_LINK}" -o "${CHECK_LINK}" = "y" -o "${CHECK_LINK}" = "yes" -o "${CHECK_LINK}" = "1" ]; then
63 if ip link show ${1} > /dev/null 2>&1; then
64 link_status=`ip link show ${1}`
65 if [ -n "${link_status}" ]; then
66 if ! echo "${link_status}" | grep -q UP; then
67 ip link set ${1} up
68 evaluate_retval standard
69 fi
70 fi
71 else
72 message="${message}Interface ${1} doesn't exist."
73 log_warning_msg
74 fi
75 fi
76 IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE} ${1} up
77 else
78 echo -e "${FAILURE}Unable to process ${file}. Either"
79 echo -e "${FAILURE}the SERVICE variable was not set,"
80 echo -e "${FAILURE}or the specified service cannot be executed."
81 message=""
82 log_failure_msg
83 fi
84 )
85done
86
87# End $NETWORK_DEVICES/ifup
Note: See TracBrowser for help on using the repository browser.