summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-05-25 11:51:16 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-05-25 11:51:16 +0200
commit763e43d05c8cf89bce90ae0aaf6d0266badc1c73 (patch)
tree66a56ca78f6f2c894380355430bff5cc5f093800
parent82b74a39a15b94d292107c3efc1489f060c9443d (diff)
downloadbin-763e43d05c8cf89bce90ae0aaf6d0266badc1c73.zip
bin-763e43d05c8cf89bce90ae0aaf6d0266badc1c73.tar.gz
calls to ip use -p flag
-rw-r--r--bashrc2
-rwxr-xr-xnetset2
2 files changed, 2 insertions, 2 deletions
diff --git a/bashrc b/bashrc
index 1860b95..2ac0282 100644
--- a/bashrc
+++ b/bashrc
@@ -85,7 +85,7 @@ alias fuck='eval $(thefuck $(fc -ln -1)); history -r'
# FUNCTIONS
function lip () { # local ips
- ip -c addr | sed -n '/^[1-9]:/p;/inet /p'
+ ip -4 -c addr | sed -n '/^[1-9]:/p;/inet/p'
}
function xip () { # external ip
diff --git a/netset b/netset
index 747df16..83e19b9 100755
--- a/netset
+++ b/netset
@@ -27,7 +27,7 @@ do
N=$((N + 1))
[ $N -eq 10 ] && echo " failure" && exit 1
echo -n "." && sleep 1
- ADDR=$(ip -c addr show dev $dev | sed -n '/inet /p')
+ ADDR=$(ip -4 -c addr show dev $dev | sed -n '/inet/p')
done
echo
echo $ADDR