local_ip.sh 179 B

12345678
  1. #!/usr/bin/env bash
  2. # Shows the local network ip for the current machine.
  3. ip_line=$(ip addr show | grep 'inet 192.168')
  4. the_ip=$(echo $ip_line | awk '{print $2;}')
  5. echo $the_ip