From: Michael Tremer Date: Mon, 31 Oct 2011 19:29:03 +0000 (+0000) Subject: Change funtion to detect ppp devices. X-Git-Tag: 003~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55b802cc1475fa2b4bb4316c03fc3d5857f3f911;p=network.git Change funtion to detect ppp devices. Calling ip is not very fast. --- diff --git a/functions.device b/functions.device index bb47baed..ff141270 100644 --- a/functions.device +++ b/functions.device @@ -125,7 +125,12 @@ function device_has_virtuals() { function device_is_ppp() { local device=${1} - ip link show ${device} 2>/dev/null | grep -qE "<.*POINTOPOINT.*>" + local type=$(__device_get_file ${device} type) + if [ "${type}" = "512" ]; then + return ${EXIT_OK} + fi + + return ${EXIT_ERROR} } # Check if the device is a loopback device