From: Michael Tremer Date: Tue, 15 Aug 2017 21:16:47 +0000 (+0000) Subject: Print a useful message when bringing up a port that has not been created, yet X-Git-Tag: 010~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f28e991c0c4e97bbddd6f14ca2f9488cefd34762;p=network.git Print a useful message when bringing up a port that has not been created, yet Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.ports b/src/functions/functions.ports index af3f5f06..f7ea1a0b 100644 --- a/src/functions/functions.ports +++ b/src/functions/functions.ports @@ -238,7 +238,17 @@ port_edit() { } port_up() { - port_cmd up $@ + assert [ $# -eq 1 ] + + local port="${1}" + + # Check if the port exists + if ! device_exists "${port}"; then + log ERROR "Could not bring up port ${port} which has not been created" + return ${EXIT_ERROR} + fi + + port_cmd up "${port}" } port_down() {