Skip to content
Snippets Groups Projects
Commit b407a0c7 authored by Silvan's avatar Silvan
Browse files

bug fix

parent c39dcc60
No related branches found
No related tags found
No related merge requests found
......@@ -41,10 +41,12 @@ func main() {
go func() {
sig := <-signalChan
fmt.Println("\nreceive signal:", sig)
fmt.Println("restoreHosts ing...")
err := host.RestoreHosts()
if err != nil {
fmt.Println("restoreHosts error:", err)
if *config.Mode == 1 {
fmt.Println("restoreHosts...")
err := host.RestoreHosts()
if err != nil {
fmt.Println("restoreHosts error:", err)
}
}
exit <- true
}()
......
......@@ -15,7 +15,7 @@ buildGo() {
fi
echo "Building($GOOS/$GOARCH)..."
TargetDir=bin/$GOOS/$GOARCH
env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "-X '$Path.Version=$CurrentVersion' -X '$Path.BuildTime=$BuildTime' -X '$Path.GoVersion=$GoVersion' -X '$Path.GitCommit=$GitCommit' -w -s" -o $TargetDir/$output_name
env GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 go build -ldflags "-X '$Path.Version=$CurrentVersion' -X '$Path.BuildTime=$BuildTime' -X '$Path.GoVersion=$GoVersion' -X '$Path.GitCommit=$GitCommit' -w -s" -o $TargetDir/$output_name
if [ $? -ne 0 ]; then
echo 'An error has occurred! Aborting the script execution...'
exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment