diff options
author | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2012-08-29 20:45:23 +0000 |
---|---|---|
committer | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2012-08-29 20:45:23 +0000 |
commit | cb02946abfe632bc90f1eaa302b2d8d4eb73e5c9 (patch) | |
tree | 0a19838c2a1d6b59f976c3138554eb4963bf1903 /lsb-bootscripts/sbin/ifup | |
parent | d7f2eb08dab7e6dd88df0102ec48dce0a301dc5f (diff) |
Lots of spelling fixes.
Delete the no longer used lsb-bootscripts directory
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9967 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'lsb-bootscripts/sbin/ifup')
-rw-r--r-- | lsb-bootscripts/sbin/ifup | 160 |
1 files changed, 0 insertions, 160 deletions
diff --git a/lsb-bootscripts/sbin/ifup b/lsb-bootscripts/sbin/ifup deleted file mode 100644 index 0c7fbddea..000000000 --- a/lsb-bootscripts/sbin/ifup +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin /sbin/ifdown -# -# Description : Interface Up -# -# Authors : DJ Lucas - dj@linuxfromscratch.org -# -# Version : 00.02 -# -######################################################################## - -. /lib/lsb/init-functions - -function get_args() - { - if test -z "${1}" ; then - showhelp - exit 1 - fi - - while test -n "${1}" ; do - case "${1}" in - -c | --configfile) - check_arg $1 $2 - CONFIGFILE="${2}" - shift 2 - ;; - eth* | iw* | wlan*) - INTERFACE="${1}" - shift 1 - ;; - -h | --help) - showhelp - exit 0 - ;; - *) - showhelp - echo "ERROR: '${1}' unknown argument" - echo "" - exit 2 - ;; - esac - done - } - -function check_arg() - { - echo "${2}" | grep -v "^-" > /dev/null - if [ -z "${?}" -o ! -n "${2}" ]; then - echo "Error: ${1} requires a valid argument." - exit 2 - fi - } - -function showhelp() - { - echo "`/usr/bin/basename ${0}` brings up a valid network interface." - echo "" - echo "Options:" - echo " -c --configfile The path to an interface configuration file" - echo " If no configuration file is given, all files" - echo " listed in ${NETWORK_DEVICES}/ifconfig.<int> will" - echo " be processed, regarless of the value of ONBOOT" - echo " -h --help Show this help message and exit." - echo "" - echo "Examples:" - echo " `/usr/bin/basename ${0}` eth0 -c ${NETWORK_DEVICES}/ifconfig.eth0/ipv4" - echo " `/usr/bin/basename ${0}` eth0" - echo "" - echo "" - } - -# Intialize empty variables so that the shell does not polute the script -CONFIGFILE="" -CONFIGDIR="" -INTERFACE="" - -# Process command line arguments -get_args ${@} - -# Handle common errors - No need to account for bootscripts, this should not -# happen during boot or shutdown. -if [ "${CONFIGFILE}x" != "x" -a ! -f "${CONFIGFILE}" ]; then - echo "ERROR: ${CONFIGFILE} is not a valid network configuration file." - echo "" - exit 2 -fi - -if [ "${INTERFACE}x" == "x" ]; then - echo "ERROR: No interface was given" - echo "" - exit 2 -else - if ! grep "${INTERFACE}" /proc/net/dev 2>&1 > /dev/null; then - echo "ERROR: ${INTERFACE} is not a valid network interface." - echo "" - exit 2 - fi -fi - -# If a configuration file is present, use it -if [ "${CONFIGFILE}x" != "x" ]; then - . "${CONFIGFILE}" - if [ -x "/lib/network-services/${SERVICE}" ]; then - # do the work - # Check to make sure the interface is up - link_status=`/sbin/ip link show "${INTERFACE}" | \ - grep -o "state UP"` - if [ "${link_status}" != "state UP" ]; then - message="Bringing up the ${INTERFACE} interface..." - /sbin/ip link set ${INTERFACE} up - evaluate_retval standard - fi - if IFCONFIG=${CONFIGFILE} \ - /lib/network-services/${SERVICE} ${INTERFACE} up; then - mkdir -p "/run/network/ifconfig.${INTERFACE}" - cp "${CONFIGFILE}" "/run/network/ifconfig.${INTERFACE}/" - fi - else - echo "ERROR: Service '${SERVICE}' is not a valid service." - echo "" - exit 2 - fi -# No interface configuration file was given -else - # Process all available interface configuration files - CONFIGDIR="/etc/network/ifconfig.${INTERFACE}" - if [ -d "${CONFIGDIR}" ]; then - FILES=`ls "${CONFIGDIR}"` - for CONFIGFILE in ${FILES} - do - ( - . "${CONFIGDIR}/${CONFIGFILE}" - if [ -x "/lib/network-services/${SERVICE}" ]; then - # Check to make sure the interface is up - link_status=`/sbin/ip link show "${INTERFACE}" | \ - grep -o "state UP"` - if [ "${link_status}" != "state UP" ]; then - message="Bringing up the ${INTERFACE} interface..." - /sbin/ip link set ${INTERFACE} up - evaluate_retval standard - fi - if IFCONFIG="${CONFIGDIR}/${CONFIGFILE}" \ - /lib/network-services/${SERVICE} ${INTERFACE} up; then - mkdir -p "/run/network/ifconfig.${INTERFACE}" - cp "${CONFIGDIR}/${CONFIGFILE}" \ - "/run/network/ifconfig.${INTERFACE}/" - fi - else - echo "ERROR: Service '${SERVICE}' is not a valid service." - echo "" - exit 2 - fi - - ) - done - fi -fi - |