From 4b22390faf792b42afbf80f2e3ae9d115e84e699 Mon Sep 17 00:00:00 2001 From: Ulric Qin Date: Tue, 29 Dec 2020 12:00:17 +0800 Subject: [PATCH] refactor ip shell --- etc/identity.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/identity.yml b/etc/identity.yml index 03e636a9..0471088d 100644 --- a/etc/identity.yml +++ b/etc/identity.yml @@ -1,9 +1,9 @@ # 用来做心跳,给服务端上报本机ip ip: specify: "" - shell: ifconfig `route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|head -n 1 + shell: ifconfig `route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|head -n 1|awk -F':' '{print $NF}' # MON、JOB的客户端拿来做本机标识 ident: specify: "" - shell: ifconfig `route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|head -n 1 \ No newline at end of file + shell: ifconfig `route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|head -n 1|awk -F':' '{print $NF}' \ No newline at end of file