mirror of
				https://github.com/byReqz/conn.git
				synced 2025-11-04 05:11:31 +00:00 
			
		
		
		
	fix issue with unrecognized arguments
This commit is contained in:
		
							
								
								
									
										6
									
								
								conn.sh
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								conn.sh
									
									
									
									
									
								
							@@ -76,6 +76,10 @@ function get_args {
 | 
			
		||||
#      echo "the given argument \""$arg"\" is not known"
 | 
			
		||||
#    done
 | 
			
		||||
#  fi
 | 
			
		||||
 | 
			
		||||
  #quick fix to prevent nslookups interactive mode being triggered by wrong arguments
 | 
			
		||||
  #some other places in the code have also gotten a leading space to prevent similar issues
 | 
			
		||||
  input=$(echo "$input" | tr -d "-")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function set_argvars {
 | 
			
		||||
@@ -104,7 +108,7 @@ function set_argvars {
 | 
			
		||||
 | 
			
		||||
function validate {
 | 
			
		||||
  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"
 | 
			
		||||
    elif $(nslookup "$arg" > /dev/null);then
 | 
			
		||||
      hosts="$hosts $arg"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user