- Timestamp:
- 08/02/2011 02:15:42 AM (13 years ago)
- Branches:
- 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
- Children:
- a2e555d
- Parents:
- 75fe599
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/lfs/sysconfig/network-devices/services/ipv4-static-route
r75fe599 r0cda898 1 1 #!/bin/sh 2 2 ######################################################################## 3 # Begin $network_devices/services/ipv4-static-route3 # Begin /lib/boot/ipv4-static-route 4 4 # 5 5 # Description : IPV4 Static Route Script 6 6 # 7 7 # Authors : Kevin P. Fleming - kpfleming@linuxfromscratch.org 8 # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org 8 9 # 9 # Version : 00.00 10 # 11 # Notes : 10 # Version : LFS 7.0 12 11 # 13 12 ######################################################################## 14 13 15 . /etc/sysconfig/rc 16 . ${rc_functions} 14 . /lib/boot/functions 17 15 . ${IFCONFIG} 18 16 19 17 case "${TYPE}" in 20 21 22 23 18 ("" | "network") 19 need_ip=1 20 need_gateway=1 21 ;; 24 22 25 26 27 28 29 23 ("default") 24 need_gateway=1 25 args="${args} default" 26 desc="default" 27 ;; 30 28 31 32 33 29 ("host") 30 need_ip=1 31 ;; 34 32 35 36 37 38 39 33 ("unreachable") 34 need_ip=1 35 args="${args} unreachable" 36 desc="unreachable " 37 ;; 40 38 41 42 43 44 45 39 (*) 40 boot_mesg "Unknown route type (${TYPE}) in ${IFCONFIG}, cannot continue." ${FAILURE} 41 echo_failure 42 exit 1 43 ;; 46 44 esac 47 45 48 46 if [ -n "${need_ip}" ]; then 49 50 51 52 53 47 if [ -z "${IP}" ]; then 48 boot_mesg "IP variable missing from ${IFCONFIG}, cannot continue." ${FAILURE} 49 echo_failure 50 exit 1 51 fi 54 52 55 56 57 58 59 60 61 62 53 if [ -z "${PREFIX}" ]; then 54 boot_mesg "PREFIX variable missing from ${IFCONFIG}, cannot continue." ${FAILURE} 55 echo_failure 56 exit 1 57 fi 58 59 args="${args} ${IP}/${PREFIX}" 60 desc="${desc}${IP}/${PREFIX}" 63 61 fi 64 62 65 63 if [ -n "${need_gateway}" ]; then 66 67 68 69 70 71 64 if [ -z "${GATEWAY}" ]; then 65 boot_mesg "GATEWAY variable missing from ${IFCONFIG}, cannot continue." ${FAILURE} 66 echo_failure 67 exit 1 68 fi 69 args="${args} via ${GATEWAY}" 72 70 fi 73 71 … … 77 75 78 76 case "${2}" in 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 77 up) 78 boot_mesg "Adding '${desc}' route to the ${1} interface..." 79 ip route add ${args} dev ${1} 80 evaluate_retval 81 ;; 82 83 down) 84 boot_mesg "Removing '${desc}' route from the ${1} interface..." 85 ip route del ${args} dev ${1} 86 evaluate_retval 87 ;; 88 89 *) 90 echo "Usage: ${0} [interface] {up|down}" 91 exit 1 92 ;; 95 93 esac 96 94 97 # End $network_devices/services/ipv4-static-route95 # End /bib/boot/ipv4-static-route
Note:
See TracChangeset
for help on using the changeset viewer.