MTD 248-645A Manual de usuario Pagina 329

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 347
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 328
Linux From Scratch - Version 7.0
309
log_info_msg2 "\n" # Terminate the previous message
log_info_msg "Adding IPv4 address ${IP} to the ${1} interface..."
ip addr add ${args} dev ${1}
evaluate_retval
if [ -n "${GATEWAY}" ]; then
if ip route | grep -q default; then
log_warning_msg "\nGateway already setup; skipping."
else
log_info_msg "Setting up default gateway..."
ip route add default via ${GATEWAY} dev ${1}
evaluate_retval
fi
fi
else
msg="Cannot add IPv4 address ${IP} to ${1}. Already present."
log_warning_msg "$msg"
fi
;;
down)
if [ "$(ip addr show ${1} | grep ${IP})" != "" ]; then
log_info_msg "Removing IPv4 address ${IP} from the ${1} interface..."
ip addr del ${args} dev ${1}
evaluate_retval
fi
if [ -n "${GATEWAY}" ]; then
# Only remove the gateway if ther are no remaining ipv4 addresses
if [ "$(ip addr show ${1} | grep 'inet ')" != "" ]; then
log_info_msg "Removing default gateway..."
ip route del default
evaluate_retval
fi
fi
;;
*)
echo "Usage: ${0} [interface] {up|down}"
exit 1
;;
esac
# End /lib/services/ipv4-static
D.29. /lib/services/ipv4-static-route
#!/bin/sh
########################################################################
# Begin /lib/services/ipv4-static-route
#
# Description : IPV4 Static Route Script
#
# Authors : Kevin P. Fleming - [email protected]
# DJ Lucas - [email protected]
# Update : Bruce Dubbs - [email protected]
Vista de pagina 328
1 2 ... 324 325 326 327 328 329 330 331 332 333 334 ... 346 347

Comentarios a estos manuales

Sin comentarios