mirror of
				https://github.com/byReqz/conn.git
				synced 2025-11-04 05:11:31 +00:00 
			
		
		
		
	optimize validate function
This commit is contained in:
		
							
								
								
									
										4
									
								
								conn.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								conn.sh
									
									
									
									
									
								
							@@ -108,9 +108,9 @@ function set_argvars {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function validate {
 | 
					function validate {
 | 
				
			||||||
  for arg in $@; do
 | 
					  for arg in $@; do
 | 
				
			||||||
    if $(ip route show " $arg" 2&> /dev/null);then
 | 
					    if ip route show " $arg" 2&> /dev/null;then
 | 
				
			||||||
      hosts="$hosts $arg"
 | 
					      hosts="$hosts $arg"
 | 
				
			||||||
    elif $(nslookup "$arg" > /dev/null);then
 | 
					    elif nslookup "$arg" > /dev/null;then
 | 
				
			||||||
      hosts="$hosts $arg"
 | 
					      hosts="$hosts $arg"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      echo "invalid input: $arg"
 | 
					      echo "invalid input: $arg"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user