dotfiles/config/polybar/scripts/network/ip.sh

7 lines
188 B
Bash
Raw Normal View History

2023-02-06 17:56:36 -05:00
#! /bin/sh
local_interface=$(route | awk '/^default/{print $NF}')
local_ip=$(ip addr show "$local_interface" | grep -w "inet" | awk '{ print $2; }' | sed 's/\/.*$//')
echo "# $local_ip"