Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59de947

Browse files
committed
[bug] 修复ip文件不支持域名的问题
[feat] 增加对arm64体系支持
1 parent d5a7597 commit 59de947

File tree

13 files changed

+18
-7
lines changed

13 files changed

+18
-7
lines changed

bin/386/linux/gossh

-535 KB
Binary file not shown.

bin/386/linux/passtool

-116 KB
Binary file not shown.

bin/386/windows/gossh.exe

-444 KB
Binary file not shown.

bin/386/windows/passtool.exe

-67 KB
Binary file not shown.

bin/amd64/linux/gossh

-336 KB
Binary file not shown.

bin/amd64/linux/log/gossh.log

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2019/04/24 00:16:18.309 [I] gossh -t=cmd cmd=[uname]
2+
2019/04/24 00:16:18.310 [I] [servers]=[192.168.56.2 localhost]
3+
2019/04/24 00:16:40.143 [I] gossh -t=cmd cmd=[uname]
4+
2019/04/24 00:16:40.143 [I] [servers]=[192.168.56.2 localhost]
5+
2019/04/24 00:16:57.501 [I] gossh -t=cmd cmd=[uname]
6+
2019/04/24 00:16:57.529 [I] [servers]=[192.168.56.2 localhost baidu.com]

bin/amd64/linux/passtool

-75.2 KB
Binary file not shown.

bin/amd64/windows/gossh.exe

-271 KB
Binary file not shown.

bin/amd64/windows/passtool.exe

-44.5 KB
Binary file not shown.

bin/arm64/linux/gossh

6.9 MB
Binary file not shown.

bin/arm64/linux/passtool

2.02 MB
Binary file not shown.

build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ workhome=$(cd $(dirname $0) && pwd)
1010
binpath=${workhome}/bin
1111

1212
oss=(linux windows)
13-
arches=(amd64 386)
13+
arches=(amd64 386 arm64)
1414
target=(gossh passtool)
1515

1616
for arch in ${arches[@]};do
1717
for os in ${oss[@]};do
1818
for t in ${target[@]};do
19+
if [[ ${arch} == "arm64" && ${os} == "windows" ]];then
20+
continue
21+
fi
1922
cmd="CGO_ENABLED=0 GOOS=${os} GOARCH=${arch} go build"
2023
echo "${cmd} ${t}.go"
2124
eval ${cmd} ${t}.go

config/parsefile.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,25 @@ func parseLine(s string, eflag bool) (Host, error) {
154154
}
155155

156156
fields := strings.Split(line, "|")
157-
ip := net.ParseIP(fields[0])
158-
if ip == nil {
157+
//ip := net.ParseIP(fields[0])
158+
hname := strings.TrimSpace(fields[0])
159+
_, err := net.LookupHost(hname)
160+
if err != nil {
159161
return host, errors.New("ill ip")
160162
}
161163
lens := len(fields)
162164
switch lens {
163165
case 1:
164-
host.Ip = strings.TrimSpace(fields[0])
166+
host.Ip = hname
165167
case 2:
166-
host.Ip = strings.TrimSpace(fields[0])
168+
host.Ip = hname
167169
host.Port = strings.TrimSpace(fields[1])
168170
case 3:
169-
host.Ip = strings.TrimSpace(fields[0])
171+
host.Ip = hname
170172
host.Port = strings.TrimSpace(fields[1])
171173
host.User = strings.TrimSpace(fields[2])
172174
case 4:
173-
host.Ip = strings.TrimSpace(fields[0])
175+
host.Ip = hname
174176
host.Port = strings.TrimSpace(fields[1])
175177
host.User = strings.TrimSpace(fields[2])
176178
pass := strings.TrimSpace(fields[3])

0 commit comments

Comments
 (0)