Changeset efc99f2 for bootscripts/clfs
- Timestamp:
- Oct 31, 2006, 9:38:50 PM (18 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 728f219
- Parents:
- 0928ac4
- Location:
- bootscripts/clfs/sysconfig/network-devices
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/clfs/sysconfig/network-devices/ifdown
r0928ac4 refc99f2 62 62 continue 63 63 fi 64 64 65 # This will allow us to assign subinterfaces to our primary 66 if [ "${INTERFACE}" != "" ]; then 67 NET_IF=${INTERFACE} 68 else 69 NET_IF=${1} 70 fi 71 65 72 # This will run the service script, if SERVICE is set 66 if [ -n "${SERVICE}" -a -x "${network_devices}/services/${SERVICE}" ]; then 67 TEST="`ip addr show ${1} | grep inet | cut -f1 -d'/' | cut -f2 -d't' | cut -f2 -d' '`" 68 if [ -z "$TEST" ]; then 69 boot_mesg "Interface ${1} already disabled." ${WARNING} 70 echo_warning 73 if [ "${INTERFACE}" = "" ]; then 74 if [ -n "${SERVICE}" -a -x "${network_devices}/services/${SERVICE}" ]; then 75 TEST="`ip addr show ${NET_IF} | grep inet | grep ${NET_IF} | cut -f1 -d'/' | cut -f2 -d't' | cut -f2 -d' '`" 76 if [ -z "$TEST" ]; then 77 boot_mesg "Interface ${NET_IF} already disabled." ${WARNING} 78 echo_warning 79 continue 80 else 81 if ip link show ${NET_IF} > /dev/null 2>&1; then 82 IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${NET_IF} down 83 else 84 boot_mesg "Interface ${NET_IF} doesn't exist." ${WARNING} 85 echo_warning 86 fi 87 fi 88 else 89 boot_mesg -n "Unable to process ${file}. Either" ${FAILURE} 90 boot_mesg -n " the SERVICE variable was not set," 91 boot_mesg " or the specified service cannot be executed." 92 echo_failure 71 93 continue 72 else73 if ip link show ${1} > /dev/null 2>&1; then74 IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${1} down75 else76 boot_mesg "Interface ${1} doesn't exist." ${WARNING}77 echo_warning78 fi79 94 fi 80 else81 boot_mesg -n "Unable to process ${file}. Either" ${FAILURE}82 boot_mesg -n " the SERVICE variable was not set,"83 boot_mesg " or the specified service cannot be executed."84 echo_failure85 continue86 95 fi 87 96 ) 88 97 done 89 98 90 if [ -z "${2}" ]; then 91 link_status=`ip link show ${1} 2> /dev/null | grep ${1}` 92 if [ -n "${link_status}" ]; then 93 if echo "${link_status}" | grep -q UP; then 94 boot_mesg "Bringing down the ${1} interface..." 95 ip link set ${1} down 96 evaluate_retval 97 fi 99 if [ "${INTERFACE}" = "" ]; then 100 if [ -z "${2}" ]; then 101 boot_mesg "Bringing down the ${1} interface..." 102 ip link set ${1} down 103 evaluate_retval 98 104 fi 99 105 fi -
bootscripts/clfs/sysconfig/network-devices/ifup
r0928ac4 refc99f2 61 61 fi 62 62 63 # This will allow us to assign subinterfaces to our primary 64 if [ "${INTERFACE}" != "" ]; then 65 NET_IF=${INTERFACE} 66 else 67 NET_IF=${1} 68 fi 69 63 70 if [ -n "${SERVICE}" -a -x "${network_devices}/services/${SERVICE}" ]; then 64 71 if [ -z "${CHECK_LINK}" -o "${CHECK_LINK}" = "y" -o "${CHECK_LINK}" = "yes" -o "${CHECK_LINK}" = "1" ]; then 65 TEST="`ip addr show ${ 1} | grep inet| cut -f1 -d'/' | cut -f2 -d't' | cut -f2 -d' '`"72 TEST="`ip addr show ${NET_IF} | grep inet | grep ${NET_IF} | cut -f1 -d'/' | cut -f2 -d't' | cut -f2 -d' '`" 66 73 if [ "$TEST" != "" ]; then 67 boot_mesg "Interface ${ 1} already configured with IP ${TEST}." ${WARNING}74 boot_mesg "Interface ${NET_IF} already configured with IP ${TEST}." ${WARNING} 68 75 echo_warning 69 76 continue 70 77 else 71 if ip link show ${ 1} > /dev/null 2>&1; then72 link_status=`ip link show ${ 1} 2> /dev/null | grep ${1}`78 if ip link show ${NET_IF} > /dev/null 2>&1; then 79 link_status=`ip link show ${NET_IF} 2> /dev/null | grep ${NET_IF}` 73 80 if [ -n "${link_status}" ]; then 74 81 if ! echo "${link_status}" | grep -q UP; then 75 ip link set ${ 1} up82 ip link set ${NET_IF} up 76 83 fi 77 84 fi 78 85 else 79 boot_mesg "Interface ${ 1} doesn't exist." ${WARNING}86 boot_mesg "Interface ${NET_IF} doesn't exist." ${WARNING} 80 87 echo_warning 81 88 continue … … 83 90 fi 84 91 fi 85 IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${ 1} up92 IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${NET_IF} up 86 93 else 87 94 boot_mesg "Unable to process ${file}. Either" ${FAILURE} -
bootscripts/clfs/sysconfig/network-devices/services/ipv4-static
r0928ac4 refc99f2 51 51 up) 52 52 boot_mesg "Adding IPv4 address ${IP} to the ${1} interface..." 53 ip addr add ${args} dev ${1} 53 if [ "${INTERFACE}" != "" ]; then 54 ip addr add ${args} dev ${1} label ${1} 55 else 56 ip addr add ${args} dev ${1} 57 fi 54 58 evaluate_retval 55 59 56 if [ -n "${GATEWAY}" ]; then 57 if ip route | grep -q default; then 58 boot_mesg "Gateway already setup; skipping." ${WARNING} 59 echo_warning 60 else 61 boot_mesg "Setting up default gateway..." 62 ip route add default via ${GATEWAY} dev ${1} 63 evaluate_retval 64 fi 60 if [ "${INTERFACE}" = "" ]; then 61 if [ -n "${GATEWAY}" ]; then 62 if ip route | grep -q default; then 63 boot_mesg "Gateway already setup; skipping." ${WARNING} 64 echo_warning 65 else 66 boot_mesg "Setting up default gateway..." 67 ip route add default via ${GATEWAY} dev ${1} 68 evaluate_retval 69 fi 70 fi 65 71 fi 66 72 ;; 67 73 68 74 down) 69 if [ -n "${GATEWAY}" ];then70 boot_mesg "Removing default gateway..."71 ip route del default75 if [ "${INTERFACE}" = "" ]; then 76 boot_mesg "Removing Settings From ${1} interface..." 77 ip address flush dev ${1} 72 78 evaluate_retval 73 79 fi 74 75 boot_mesg "Removing IPv4 address ${IP} from the ${1} interface..."76 ip addr del ${args} dev ${1}77 evaluate_retval78 80 ;; 79 81
Note:
See TracChangeset
for help on using the changeset viewer.