jpackage stuff

This commit is contained in:
idk
2022-02-20 00:05:57 -05:00
parent 789e2d6d94
commit b6b2ee50de
5 changed files with 55 additions and 44 deletions

74
main.go
View File

@ -140,49 +140,47 @@ func main() {
}
log.Println("Using auto-detected language", *lang)
}
if tbget.TestHTTPDefaultProxy() {
log.Println("I2P HTTP proxy OK")
} else {
log.Println("I2P HTTP proxy not OK")
run, err := i2cpcheck.ConditionallyLaunchI2P()
if err != nil {
log.Println("Couldn't launch I2P", err)
}
if run {
if tbget.TestHTTPDefaultProxy() {
log.Println("I2P HTTP proxy OK after launching I2P")
} else {
go proxy()
if !tbget.TestHTTPBackupProxy() {
log.Fatal("Please set the I2P HTTP proxy on localhost:4444", err)
}
}
} else {
I2Pdaemon, err := I2P.NewDaemon(*directory, false)
if err != nil {
log.Println(err)
return
}
if err = I2Pdaemon.Start(); err != nil {
log.Fatal(err)
}
shutdown = true
defer I2Pdaemon.Stop()
go runSysTray(true)
if tbget.TestHTTPDefaultProxy() {
log.Println("I2P HTTP proxy OK")
} else {
log.Fatal("Embedded i2pd unable to start")
}
}
}
var err error
client, err = tbserve.NewClient(*verbose, *lang, *system, *arch, *mirror, &content)
if err != nil {
log.Fatal("Couldn't create client", err)
}
if *i2pbrowser || *i2pconfig {
if tbget.TestHTTPDefaultProxy() {
log.Println("I2P HTTP proxy OK")
} else {
log.Println("I2P HTTP proxy not OK")
run, err := i2cpcheck.ConditionallyLaunchI2P()
if err != nil {
log.Println("Couldn't launch I2P", err)
}
if run {
if tbget.TestHTTPDefaultProxy() {
log.Println("I2P HTTP proxy OK after launching I2P")
} else {
go proxy()
if !tbget.TestHTTPBackupProxy() {
log.Fatal("Please set the I2P HTTP proxy on localhost:4444", err)
}
}
} else {
I2Pdaemon, err := I2P.NewDaemon(*directory, false)
if err != nil {
log.Println(err)
return
}
if err = I2Pdaemon.Start(); err != nil {
log.Fatal(err)
}
shutdown = true
defer I2Pdaemon.Stop()
go runSysTray(true)
if tbget.TestHTTPDefaultProxy() {
log.Println("I2P HTTP proxy OK")
} else {
log.Fatal("Embedded i2pd unable to start")
}
}
}
}
if *apparmor {
err := GenerateAppArmor()
if err != nil {