mirror of
				https://github.com/byReqz/probehost2.git
				synced 2025-11-04 00:11:30 +00:00 
			
		
		
		
	fix command order if host is invalid but port proper
This commit is contained in:
		
							
								
								
									
										3
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								main.go
									
									
									
									
									
								
							@@ -106,6 +106,8 @@ func validatehosts(hosts []string) ([]string, []string) {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		} else if _, err := net.LookupIP(host); err == nil {
 | 
							} else if _, err := net.LookupIP(host); err == nil {
 | 
				
			||||||
			validhosts = append(validhosts, host)
 | 
								validhosts = append(validhosts, host)
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		var port string
 | 
							var port string
 | 
				
			||||||
@@ -156,7 +158,6 @@ func prerunner(req *http.Request, cmd string, cmdopts map[string]string, default
 | 
				
			|||||||
			runargs = append(runargs, "-p"+ports[i])
 | 
								runargs = append(runargs, "-p"+ports[i])
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		runargs = append(runargs, host)
 | 
							runargs = append(runargs, host)
 | 
				
			||||||
		fmt.Println(remoteaddr, cmd, runargs)
 | 
					 | 
				
			||||||
		res = fmt.Sprint(res, runner(remoteaddr, cmd, runargs...), "\n")
 | 
							res = fmt.Sprint(res, runner(remoteaddr, cmd, runargs...), "\n")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return res
 | 
						return res
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user