From 71116bc525ee93934cea62c3e7c3db4712b13b2d Mon Sep 17 00:00:00 2001 From: chi-chi weng <949409306@qq.com> Date: Wed, 23 Dec 2015 15:17:14 +0800 Subject: [PATCH] fix remote ip bug fix remote ip bug --- connect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect.py b/connect.py index 1d52a75d9..e38dfa751 100755 --- a/connect.py +++ b/connect.py @@ -32,7 +32,7 @@ from jperm.ansible_api import MyRunner from jlog.models import ExecLog, FileLog login_user = get_object(User, username=getpass.getuser()) -remote_ip = os.popen("who -m | awk '{ print $5 }'").read().strip('()\n') +remote_ip = os.popen("who -m | awk '{ print $NF }'").read().strip('()\n') try: import termios