summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e5c41b3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,36 @@
+There are two kinds of people in this world. Those who use just one single
+smartphone for all their information technology needs, and those who suddenly
+find themselves with more devices than they can keep track of without having
+information about them written down somewhere.
+
+If you are anything like me, sharing home with a couple of actively used
+laptops, several smartphones, document and label printers, physical servers,
+virtual servers and IoT things doing all kinds of weirdness, then just maybe
+hisgle might be helpful to you too.
+
+I've implemented hisgle (Host Inventory Script, Go Learning Experience) having
+no less than 131 devices with individual mac addresses. Remembering exactly
+where all of them were networkwise was becoming a challenge, so I put them all
+in a database with the following structure:
+
+ CREATE TABLE devices (name, mac, interface);
+ CREATE TABLE addresses (mac, vlan, ipv4);
+ CREATE TABLE aliases (alias, target);
+ CREATE TABLE networks (vlan, description TEXT, ipv4);
+
+Invoking hisgle generates ethers and hosts files which can be read directly by
+dnsmasq on e.g. OpenWRT routers.
+
+A typical command line would be:
+
+ hisgle --database=/somewhere/devices.db hosts 4 5 104
+
+Above line would generate a hosts file for vlan:s 4, 5 and 104. You might want
+to create a script which generates, copies and reloads hosts and ethers files
+for all your routers. That's what the script I run whenever updating my list
+of devices does.
+
+Wanting to try using the Go language for a something helped giving a name to
+this script. This is the first time I attempt writing something at all in Go.
+I'm sure there are heaps of things which could be improved, but I'm happy for
+now with a script which does what I need.