ocochard / graphpath Goto Github PK
View Code? Open in Web Editor NEWGraphpath generates an ASCII network diagram from the route table of a Unix/Linux
License: BSD 2-Clause "Simplified" License
Graphpath generates an ASCII network diagram from the route table of a Unix/Linux
License: BSD 2-Clause "Simplified" License
+----------------------------+ +----------------------------+
| SOURCE HOST | | DESTINATION HOST |
| IP: xxxxxxxxxxxxx | | IP: xxxxxxxxxx |
| ARP: xxxxxxxxxxxxxxxxx || ARP: xxxxxxxxxxxxxxxxx | | |
+----------------------------+ +----------------------------+
| |
| +----------------------------+
| | ROUTER TOWARDS DESTINATION |
| | IP: xxxxxxxxxxxxx |
| | ARP: xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx|
| +----------------------------+
| |
--+---+-----------------------------+---
|
...
Looks like src_gateway_arp is coming out as:
"xxxxxxxxxxxxxxxxx\n
xxxxxxxxxxxxxxxxx"
so changing to:
printf '| ARP: %-18s |' "${src_gateway_arp:0:17}"
works.
Hello!
As this script is written, once installed on a Mac, and the user enters graphpath $source-ip $destination-ip
, the user gets the following output:
-n EXIT:
This script was not tested on Darwin
I am not certain if this is on the roadmap, but I would love to test this on MacOS/Darwin. I know it would be as simple for me as editing the case statement, but if you have no plan to support Darwin in the future, it probably wouldn't be worth my time. If you do, however plan on supporting Macs, I would be more than happy to help.
Thanks again!
Hello!
Thanks for making such a great tool. I've made a homebrew formula around it, but I'm seeing an error when building, because it appears that the v1.0 release is two commits behind current HEAD
. I can add some handling to work around this, but I figured I would ask if it was all right for me to create a v1.1.0 release for these commits before I write the work-around in the homebrew formula.
Thanks!
I can't use this for IPv6 addresses.
Hi there,
I'm testing this script on Debian sid and I see the error in the title.
More complete the more complete output:
$ ./graphpath 192.168.20.132 8.8.8.8
+-----------------------------+ +-----------------------------+
| SOURCE | | DESTINATION |
| IP: 192.168.20.132 | | IP: 8.8.8.8 |
| ARP: | | |
+-----------------------------+ +-----------------------------+
| |
./graphpath: 179: local: |: bad variable name
I was able to fix this and make the script run correctly by changing the she-bang on line one like this:
diff --git a/graphpath b/graphpath
index c00e722..7842cc5 100755
--- a/graphpath
+++ b/graphpath
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Graphpath generates an ASCII network diagram from the route table of a Unix/Linux
# https://bsdrp.net
It seems as though the script makes the assumption that /bin/sh
is bash, which is not true on many distros / platforms.
on debian, /bin/sh
is normally linked to dash
which has very limited functionality and has more a feeling of plain-old-sh-before-bash.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.