fix run, add connection check

This commit is contained in:
zhiqiang feng
2020-12-22 11:45:25 +08:00
parent 6f00ed6029
commit 13ff3f09e8
3 changed files with 54 additions and 9 deletions
+4 -4
View File
@@ -17,12 +17,13 @@ package cmd
import (
"fmt"
"it2000.com.cn/tele-recv/utils"
"log"
"os"
"os/signal"
"syscall"
"it2000.com.cn/tele-recv/utils"
"github.com/spf13/cobra"
)
@@ -41,8 +42,6 @@ to quickly create a Cobra application.`,
},
}
var run bool
func init() {
rootCmd.AddCommand(startCmd)
@@ -77,7 +76,8 @@ func start() {
sig := <-sigs
fmt.Println()
fmt.Println(sig)
run = false
utils.ServerRunning = false
utils.StopSocketServer()
done <- true
}()