diff --git a/clash/clash.go b/clash/clash.go index fc83624..eec20b7 100755 --- a/clash/clash.go +++ b/clash/clash.go @@ -7,7 +7,6 @@ import ( "os" "path/filepath" "strconv" - "sync/atomic" "github.com/Dreamacro/clash/config" C "github.com/Dreamacro/clash/constant" @@ -18,10 +17,6 @@ import ( log "github.com/sirupsen/logrus" ) -var ( - runningFlag atomic.Value -) - type ClashStartOptions struct { // HomeDir Clash config home directory HomeDir string @@ -51,15 +46,9 @@ func Start(opt *ClashStartOptions) { } ApplyRawConfig(opt) - runningFlag.Store(true) return } -func IsRunning() bool { - run := runningFlag.Load() - return run.(bool) -} - func Stop() { snapshot := statistic.DefaultManager.Snapshot() for _, c := range snapshot.Connections { @@ -75,8 +64,6 @@ func Stop() { TrojanProxyServerUdpEnabled: true, } ApplyRawConfig(opt) - - runningFlag.Store(false) } func ApplyRawConfig(opt *ClashStartOptions) { @@ -151,8 +138,3 @@ func readConfig(path string) ([]byte, error) { return data, err } - -func init() { - // default value - runningFlag.Store(false) -}