]> Cypherpunks.ru repositories - govpn.git/commitdiff
-warranty CLI option
authorSergey Matveev <stargrave@stargrave.org>
Mon, 7 Mar 2016 12:08:35 +0000 (15:08 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 7 Mar 2016 12:08:50 +0000 (15:08 +0300)
src/cypherpunks.ru/govpn/cmd/govpn-client/main.go
src/cypherpunks.ru/govpn/cmd/govpn-server/main.go
src/cypherpunks.ru/govpn/cmd/govpn-verifier/main.go
src/cypherpunks.ru/govpn/govpn.go

index 032a288c78734013b106243b6a140f7dde0af7b9..58d5ce7d8597022df5a0a9e9197cf71f1dce0cdf 100644 (file)
@@ -21,6 +21,7 @@ package main
 
 import (
        "flag"
+       "fmt"
        "log"
        "net"
        "os"
@@ -48,6 +49,7 @@ var (
        encless     = flag.Bool("encless", false, "Encryptionless mode")
        cpr         = flag.Int("cpr", 0, "Enable constant KiB/sec out traffic rate")
        egdPath     = flag.String("egd", "", "Optional path to EGD socket")
+       warranty    = flag.Bool("warranty", false, "Print warranty information")
 
        conf        *govpn.PeerConf
        tap         *govpn.TAP
@@ -59,6 +61,10 @@ var (
 
 func main() {
        flag.Parse()
+       if *warranty {
+               fmt.Println(govpn.Warranty)
+               return
+       }
        timeout = *timeoutP
        var err error
        log.SetFlags(log.Ldate | log.Lmicroseconds | log.Lshortfile)
index 5cddab87cea5d85efa7cb33bfb8109706a9ed995..606caf0ede5ccbb32c0e0e267dbadfc9d6f59793 100644 (file)
@@ -21,6 +21,7 @@ package main
 
 import (
        "flag"
+       "fmt"
        "log"
        "net"
        "os"
@@ -37,10 +38,15 @@ var (
        stats    = flag.String("stats", "", "Enable stats retrieving on host:port")
        proxy    = flag.String("proxy", "", "Enable HTTP proxy on host:port")
        egdPath  = flag.String("egd", "", "Optional path to EGD socket")
+       warranty = flag.Bool("warranty", false, "Print warranty information")
 )
 
 func main() {
        flag.Parse()
+       if *warranty {
+               fmt.Println(govpn.Warranty)
+               return
+       }
        timeout := time.Second * time.Duration(govpn.TimeoutDefault)
        log.SetFlags(log.Ldate | log.Lmicroseconds | log.Lshortfile)
        log.Println(govpn.VersionGet())
index 5d595803fcad085acd30e35f55ee896e1021fff3..bdea0791f3d165101ece4219997d1edc21d23665 100644 (file)
@@ -35,10 +35,15 @@ var (
        tOpt     = flag.Int("t", govpn.DefaultT, "Argon2d iteration parameter")
        pOpt     = flag.Int("p", govpn.DefaultP, "Argon2d parallelizm parameter")
        egdPath  = flag.String("egd", "", "Optional path to EGD socket")
+       warranty = flag.Bool("warranty", false, "Print warranty information")
 )
 
 func main() {
        flag.Parse()
+       if *warranty {
+               fmt.Println(govpn.Warranty)
+               return
+       }
        if *egdPath != "" {
                govpn.EGDInit(*egdPath)
        }
index d65e72b84038387a64714ad106b15a922f5202d8..49a11ccf659c7e30d00139cdac3ce7656733e044 100644 (file)
@@ -1,2 +1,17 @@
 // Simple secure, DPI/censorship-resistant free software VPN daemon.
 package govpn
+
+const (
+       Warranty = `This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.`
+)