Skip to content

Commit f73c954

Browse files
author
sipt
committed
fix auto disable setAsSystemProxy
1 parent f65efde commit f73c954

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cmd/main.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func main() {
102102
for {
103103
select {
104104
case fileName := <-UpgradeSignal:
105-
shutdown()
105+
shutdown(general)
106106
log.Logger.Info("[Shuttle] is shutdown, for upgrade!")
107107
var name string
108108
if runtime.GOOS == "windows" {
@@ -119,12 +119,12 @@ func main() {
119119
os.Exit(0)
120120
case <-ShutdownSignal:
121121
log.Logger.Info("[Shuttle] is shutdown, see you later!")
122-
shutdown()
122+
shutdown(general)
123123
os.Exit(0)
124124
return
125125
case <-signalChan:
126126
log.Logger.Info("[Shuttle] is shutdown, see you later!")
127-
shutdown()
127+
shutdown(general)
128128
os.Exit(0)
129129
return
130130
case <-ReloadConfigSignal:
@@ -144,11 +144,13 @@ func main() {
144144
}
145145
}
146146

147-
func shutdown() {
147+
func shutdown(general *shuttle.General) {
148148
StopSocksSignal <- true
149149
StopHTTPSignal <- true
150-
//disable system proxy
151-
DisableSystemProxy()
150+
if general.SetAsSystemProxy == "" || general.SetAsSystemProxy == shuttle.SetAsSystemProxyAuto {
151+
//disable system proxy
152+
DisableSystemProxy()
153+
}
152154
log.Logger.Close()
153155
shuttle.CloseGeoDB()
154156
time.Sleep(time.Second)

0 commit comments

Comments
 (0)