Skip to content

Commit

Permalink
Fix: comptage du nombre de chiffres
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeLeroux committed May 11, 2018
1 parent 4042cd5 commit 5286452
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dns/add_server_2_dns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ do

-ip_node=*)
server_ip=${1##*=}
typeset -i count_char=$(wc -m <<< "$server_ip")
((++count_char))
typeset -i count_char=$(wc -m <<< "$server_ip")-1
if [ $count_char -lt 1 ] || [ $count_char -gt 3 ]
then
error "Bad ip node : $server_ip"
error "Bad ip node : $server_ip (digit $count_char)"
error "Format : xxx (1, 2 or 3 digits)"
LN
info "$str_usage"
Expand Down

0 comments on commit 5286452

Please sign in to comment.