mirror of
https://github.com/Baipyrus/ProxySwitcher.git
synced 2024-12-27 05:01:45 +00:00
Revert "basic proxy error handling; exit on read proxy error"
This reverts commit 7b09ac0cda
.
This commit is contained in:
parent
b2dda4afbc
commit
0f285a5534
@ -2,7 +2,6 @@ package proxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Baipyrus/ProxySwitcher/util"
|
"github.com/Baipyrus/ProxySwitcher/util"
|
||||||
@ -21,13 +20,7 @@ func mapCmdsToStr(commands []*util.Command) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Debug() {
|
func Debug() {
|
||||||
proxy, err := ReadSystemProxy()
|
proxy, _ := ReadSystemProxy()
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Debug system proxy configuration
|
|
||||||
fmt.Println("\nSystem Proxy:")
|
fmt.Println("\nSystem Proxy:")
|
||||||
fmt.Printf("Enabled: %t\n", proxy.Enabled)
|
fmt.Printf("Enabled: %t\n", proxy.Enabled)
|
||||||
fmt.Printf("Server: %s\n\n", proxy.Server)
|
fmt.Printf("Server: %s\n\n", proxy.Server)
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
package proxy
|
package proxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/Baipyrus/ProxySwitcher/util"
|
"github.com/Baipyrus/ProxySwitcher/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Set() {
|
func Set() {
|
||||||
stdin, closeFunc, _ := util.ReadyCmd()
|
stdin, closeFunc, _ := util.ReadyCmd()
|
||||||
|
|
||||||
|
proxy, _ := ReadSystemProxy()
|
||||||
// Set system proxy, if not already
|
// Set system proxy, if not already
|
||||||
proxy, err := ReadSystemProxy()
|
if !proxy.Enabled {
|
||||||
|
SetSystemProxy(true)
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configs, _ := util.ReadConfigs()
|
configs, _ := util.ReadConfigs()
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package proxy
|
package proxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/Baipyrus/ProxySwitcher/util"
|
"github.com/Baipyrus/ProxySwitcher/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -10,12 +8,7 @@ func Unset() {
|
|||||||
stdin, closeFunc, _ := util.ReadyCmd()
|
stdin, closeFunc, _ := util.ReadyCmd()
|
||||||
|
|
||||||
// Unset system proxy, if not already
|
// Unset system proxy, if not already
|
||||||
proxy, err := ReadSystemProxy()
|
proxy, _ := ReadSystemProxy()
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if proxy.Enabled {
|
if proxy.Enabled {
|
||||||
SetSystemProxy(false)
|
SetSystemProxy(false)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user