cmd yanic-query fix help and print ip-address

This commit is contained in:
Martin Geno 2017-10-01 11:13:26 +02:00 committed by Julian K
parent cbb5f2e59b
commit 4aa8acabfc
4 changed files with 7 additions and 7 deletions

View File

@ -26,7 +26,7 @@ export PATH=$PATH:$GOPATH/bin
### Compile
```sh
go get -v -u github.com/FreifunkBremen/yanic/cmd/...
go get -v -u github.com/FreifunkBremen/yanic
```
#### Work with other databases
@ -40,7 +40,7 @@ cp /opt/go/src/github.com/FreifunkBremen/yanic/config_example.toml /etc/yanic.co
You only need to edit `/etc/yanic.conf` under section `[respondd]` the `interface` for a easy startup.
And create the following folders:
```sh
mkdir -p /var/lib/collector
mkdir -p /var/lib/yanic
mkdir -p /var/www/html/meshviewer/data
```

View File

@ -92,7 +92,7 @@ Usage:
yanic query <interface> <destination> [flags]
Examples:
yanic query wlan0 "[fe80::eade:27ff:dead:beef%wlp4s0]:1001"
yanic query wlan0 "fe80::eade:27ff:dead:beef"
Flags:
-h, --help help for query

View File

@ -16,11 +16,11 @@ var wait int
var queryCmd = &cobra.Command{
Use: "query <interface> <destination>",
Short: "Sends a query on the interface to the destination and waits for a response",
Example: `yanic query wlan0 "[fe80::eade:27ff:dead:beef%wlp4s0]:1001"`,
Example: `yanic query wlan0 "fe80::eade:27ff:dead:beef"`,
Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
iface := args[0]
dstAddress := args[1]
dstAddress := net.ParseIP(args[1])
log.Printf("Sending request address=%s iface=%s", dstAddress, iface)
@ -28,7 +28,7 @@ var queryCmd = &cobra.Command{
collector := respond.NewCollector(nil, nodes, iface, 0)
defer collector.Close()
collector.SendPacket(net.ParseIP(dstAddress))
collector.SendPacket(dstAddress)
time.Sleep(time.Second * time.Duration(wait))

View File

@ -25,7 +25,7 @@ webroot = "/var/www/html/meshviewer"
enable = true
# state-version of nodes.json to store cached data,
# these is the directly collected respondd data
state_path = "/var/lib/collector/state.json"
state_path = "/var/lib/yanic/state.json"
# Export nodes and graph periodically
save_interval = "5s"