forked from openprivacy/libricochet-go
Merge branch 'test_fix' of openprivacy/libricochet-go into master
This commit is contained in:
commit
52ce7615c3
|
@ -154,7 +154,8 @@ func createFromExisting(controlport *control.Conn, datadir string) Mixnet {
|
|||
func checkCmdlineTorVersion(torCmd string) bool {
|
||||
cmd := exec.Command(torCmd, "--version")
|
||||
out, err := cmd.CombinedOutput()
|
||||
re := regexp.MustCompile("[0-9].[0-9].[0-9].[0.9]")
|
||||
log.Println("cmdline tor version: " + string(out))
|
||||
re := regexp.MustCompile("[0-1]\\.[0-9]\\.[0-9]\\.[0-9]")
|
||||
sysTorVersion := re.Find(out)
|
||||
log.Println("cmdline tor version: " + string(sysTorVersion))
|
||||
return err == nil && minTorVersionReqs(string(sysTorVersion))
|
||||
|
@ -164,6 +165,7 @@ func checkCmdlineTorVersion(torCmd string) bool {
|
|||
// min requirment 0.3.5.x
|
||||
func minTorVersionReqs(torversion string) bool {
|
||||
torversions := strings.Split(torversion, ".") //eg: 0.3.4.8 or 0.3.5.1-alpha
|
||||
log.Printf("torversions: %v", torversions)
|
||||
tva, _ := strconv.Atoi(torversions[0])
|
||||
tvb, _ := strconv.Atoi(torversions[1])
|
||||
tvc, _ := strconv.Atoi(torversions[2])
|
||||
|
|
Loading…
Reference in New Issue