From 55b802cc1475fa2b4bb4316c03fc3d5857f3f911 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 31 Oct 2011 19:29:03 +0000 Subject: [PATCH] Change funtion to detect ppp devices. Calling ip is not very fast. --- functions.device | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.47.2