update the terminal application while I'm at it

This commit is contained in:
idk
2020-05-15 18:26:58 -04:00
parent d6caa793cd
commit 67faec9746
8 changed files with 38 additions and 13 deletions

View File

@ -69,10 +69,10 @@ zero-assets:
I2PD_VERSION=2.31.0
i2pd-clean:
rm -rf i2pdbundle/osx i2pdbundle/win_amd64 i2pdbundle/win_i386
rm -rf i2pdbundle/osx i2pdbundle/win_amd64 i2pdbundle/win_386
i2pd-zip: i2pd-clean i2pd-linux
mkdir -p i2pdbundle/mac i2pdbundle/win_amd64 i2pdbundle/test i2pdbundle/test/subtest i2pdbundle/test/subtest/subsubtest i2pdbundle/test/subsubsubtest
mkdir -p i2pdbundle/mac i2pdbundle/win_amd64 i2pdbundle/win_386 i2pdbundle/test i2pdbundle/test/subtest i2pdbundle/test/subtest/subsubtest i2pdbundle/test/subsubsubtest
wget -c -qO i2pdbundle/mac.tar.gz https://github.com/PurpleI2P/i2pd/releases/download/$(I2PD_VERSION)/i2pd_$(I2PD_VERSION)_osx.tar.gz
cd i2pdbundle/mac && cp ../mac.tar.gz .
wget -c -qO i2pdbundle/win_amd64.zip https://github.com/PurpleI2P/i2pd/releases/download/$(I2PD_VERSION)/i2pd_$(I2PD_VERSION)_win64_mingw_avx_aesni.zip

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,20 +1,45 @@
package main
import (
"github.com/eyedeekay/checki2cp"
"fmt"
"log"
"os"
"github.com/eyedeekay/checki2cp"
"github.com/eyedeekay/checki2cp/proxycheck"
"github.com/eyedeekay/checki2cp/samcheck"
)
func main() {
ok, err := checki2p.CheckI2PIsRunning()
if err != nil {
log.Fatal(err)
// CheckI2PRunning returns true if I2P is running. That's all.
func CheckI2PRunning(needI2CP, needProxy, needSAM bool) (bool, error) {
if needI2CP {
if notRunning, inError := checki2p.CheckI2PIsRunning(); inError != nil {
return false, fmt.Errorf("A strange error occurred: %s", inError)
} else if notRunning {
return true, fmt.Errorf("I2P is already running with an open I2CP port")
}
}
if ok {
log.Println("I2P is running, successfully confirmed I2CP")
} else {
log.Println("I2P is not running, further testing is needed")
if needProxy {
if checkproxy.ProxyDotI2P() {
return true, fmt.Errorf("I2P is already running with an open HTTP proxy")
}
}
if needSAM {
if checksam.CheckSAMAvailable("") {
return true, fmt.Errorf("I2P is already running with an open SAM API")
}
}
return false, fmt.Errorf("I2P is not running.")
}
func main() {
ok, err := CheckI2PRunning(true, true, true)
if err != nil {
if ok {
log.Println(err)
} else {
log.Fatal(err)
}
}
firewallport, err := checki2p.GetFirewallPort()
if err != nil {

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.