dwmblocks/dwmblocks_scripts/dwm_ipaddr
2022-12-12 15:59:27 +01:00

12 lines
236 B
Bash
Executable File

#!/bin/bash
eth="$(ip -4 addr show enp8s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
wlp="$(ip -4 addr show wlp7s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
if [[ $(echo $eth | wc -c) -gt 1 ]]
then
echo "$eth"
exit;
fi
echo "$wlp"