diff --git a/.monitoring.sh.swp b/.monitoring.sh.swp index 0eb16c8..333d53a 100644 Binary files a/.monitoring.sh.swp and b/.monitoring.sh.swp differ diff --git a/monitoring.sh b/monitoring.sh index b229f8d..6e91780 100755 --- a/monitoring.sh +++ b/monitoring.sh @@ -6,7 +6,7 @@ # By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2021/11/04 12:36:53 by gbaconni #+# #+# # -# Updated: 2021/11/04 17:34:17 by gbaconni ### lausanne.ch # +# Updated: 2021/11/04 17:43:30 by gbaconni ### lausanne.ch # # # # **************************************************************************** # @@ -62,7 +62,7 @@ ft_userlog () ft_network () { ip=$(hostname -I | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') - mac=$(arp -an | awk "/${ip}/ { print \$4 }") + mac=$(ip addr show | grep -B1 "inet ${ip}/" | awk '/ether / { print $2 }') echo "#Network: IP ${ip} (${mac})" }