dwmblocks/dwmblocks_scripts/dwm_ipaddr

12 lines
233 B
Plaintext
Raw Permalink Normal View History

2022-12-12 15:59:27 +01:00
#!/bin/bash
2023-02-24 10:48:23 +01:00
eth="$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
wlp="$(ip -4 addr show wlan0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
2022-11-09 20:00:41 +01:00
if [[ $(echo $eth | wc -c) -gt 1 ]]
then
echo "$eth"
exit;
fi
2022-12-12 15:59:27 +01:00
echo "$wlp"