The check was happening too early and in the case of error would wait 5
s and then error out. This makes it so that it does validations before
the SSH check.
Signed-off-by: Maisem Ali <maisem@tailscale.com>
iferr:=presentRiskToUser(riskLoseSSH,`You are connected over Tailscale; this action will disable Tailscale and result in your session disconnecting.`);err!=nil{
iferr:=presentRiskToUser(riskLoseSSH,`You are connected over Tailscale; this action will disable Tailscale and result in your session disconnecting.`, downArgs.acceptedRisks);err!=nil{
upf.BoolVar(&upArgs.forceDaemon,"unattended",false,"run in \"Unattended Mode\" where Tailscale keeps running even after the current GUI user logs out (Windows-only)")
upf.BoolVar(&upArgs.forceDaemon,"unattended",false,"run in \"Unattended Mode\" where Tailscale keeps running even after the current GUI user logs out (Windows-only)")
}
}
upf.DurationVar(&upArgs.timeout,"timeout",0,"maximum amount of time to wait for tailscaled to enter a Running state; default (0s) blocks forever")
upf.DurationVar(&upArgs.timeout,"timeout",0,"maximum amount of time to wait for tailscaled to enter a Running state; default (0s) blocks forever")
err=presentRiskToUser(riskLoseSSH,`You are connected over Tailscale; this action will reroute SSH traffic to Tailscale SSH and will result in your session disconnecting.`,env.upArgs.acceptedRisks)
}else{
err=presentRiskToUser(riskLoseSSH,`You are connected using Tailscale SSH; this action will result in your session disconnecting.`,env.upArgs.acceptedRisks)
err=presentRiskToUser(riskLoseSSH,`You are connected over Tailscale; this action will reroute SSH traffic to Tailscale SSH and will result in your session disconnecting.`)
}else{
err=presentRiskToUser(riskLoseSSH,`You are connected using Tailscale SSH; this action will result in your session disconnecting.`)