aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r--sysconfig/network-scripts/network-functions5
1 files changed, 2 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 562fe7cb..0d2528ee 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -51,7 +51,7 @@ get_config_by_name ()
get_device_by_hwaddr ()
{
- LANG=C ip -o link | grep -v link/ieee802.11 | awk -F ': ' -vIGNORECASE=1 "/$1/ { print \$2 }"
+ LANG=C ip -o link | awk -F ': ' -vIGNORECASE=1 '!/link\/ieee802\.11/ && /'"$1"'/ { print $2 }'
}
get_uuid_by_config ()
@@ -207,9 +207,8 @@ do_netreport ()
( cd /var/run/netreport || exit
for i in * ; do
if [ -f $i ]; then
- OWNER=$(ls -l $i | awk '{ print $3 }')
-
if [ "$(id -u)" = "0" ]; then
+ OWNER=$(stat -c %U $i)
su -s /bin/bash $OWNER -c "kill -SIGIO $i >/dev/null 2>&1 || rm -f $i >/dev/null 2>&1" > /dev/null 2>&1
else
kill -SIGIO $i >/dev/null 2>&1 || rm -f $i >/dev/null 2>&1