From 083e820f57e7cd83102eadec37e3a58cf4e06601 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 24 Oct 2015 18:44:19 +0300 Subject: [PATCH] set ip even if ip doesn't exist --- func/ip.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/func/ip.sh b/func/ip.sh index a77c62d5..9fb0a28a 100644 --- a/func/ip.sh +++ b/func/ip.sh @@ -178,7 +178,11 @@ get_real_ip() { echo $1 else nated_ip=$(grep -H "^NAT='$1'" $VESTA/data/ips/*) - echo "$nated_ip" | cut -f 1 -d : | cut -f 7 -d / + if [ ! -z "$nated_ip" ]; then + echo "$nated_ip" | cut -f 1 -d : | cut -f 7 -d / + else + get_user_ip + fi fi }