geteth 156 B

123456789
  1. #!/bin/sh
  2. # get local IP address of ethernet adapter (enp0s25)
  3. ip=$(ip addr show enp0s25 \
  4. | sed -n '3s, *inet \(.*\)/.*,\1,p' \
  5. )
  6. echo "${ip:=down}"