forked from Silverfish/proton-bridge
feat: autoupdates CLI commands
This commit is contained in:
@ -132,19 +132,31 @@ func (f *frontendCLI) changePort(c *ishell.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *frontendCLI) toggleAllowProxy(c *ishell.Context) {
|
||||
func (f *frontendCLI) allowProxy(c *ishell.Context) {
|
||||
if f.settings.GetBool(settings.AllowProxyKey) {
|
||||
f.Println("Bridge is currently set to use alternative routing to connect to Proton if it is being blocked.")
|
||||
if f.yesNoQuestion("Are you sure you want to stop bridge from doing this") {
|
||||
f.settings.SetBool(settings.AllowProxyKey, false)
|
||||
f.bridge.DisallowProxy()
|
||||
}
|
||||
} else {
|
||||
f.Println("Bridge is currently set to NOT use alternative routing to connect to Proton if it is being blocked.")
|
||||
if f.yesNoQuestion("Are you sure you want to allow bridge to do this") {
|
||||
f.settings.SetBool(settings.AllowProxyKey, true)
|
||||
f.bridge.AllowProxy()
|
||||
}
|
||||
f.Println("Bridge is already set to use alternative routing to connect to Proton if it is being blocked.")
|
||||
return
|
||||
}
|
||||
|
||||
f.Println("Bridge is currently set to NOT use alternative routing to connect to Proton if it is being blocked.")
|
||||
|
||||
if f.yesNoQuestion("Are you sure you want to allow bridge to do this") {
|
||||
f.settings.SetBool(settings.AllowProxyKey, true)
|
||||
f.bridge.AllowProxy()
|
||||
}
|
||||
}
|
||||
|
||||
func (f *frontendCLI) disallowProxy(c *ishell.Context) {
|
||||
if !f.settings.GetBool(settings.AllowProxyKey) {
|
||||
f.Println("Bridge is already set to NOT use alternative routing to connect to Proton if it is being blocked.")
|
||||
return
|
||||
}
|
||||
|
||||
f.Println("Bridge is currently set to use alternative routing to connect to Proton if it is being blocked.")
|
||||
|
||||
if f.yesNoQuestion("Are you sure you want to stop bridge from doing this") {
|
||||
f.settings.SetBool(settings.AllowProxyKey, false)
|
||||
f.bridge.DisallowProxy()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user