]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Trivial IPv6↔.meshname converter
authorSergey Matveev <stargrave@stargrave.org>
Tue, 20 Sep 2022 10:18:31 +0000 (13:18 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 20 Sep 2022 10:18:31 +0000 (13:18 +0300)
bin/meshname.sh [new file with mode: 0755]

diff --git a/bin/meshname.sh b/bin/meshname.sh
new file mode 100755 (executable)
index 0000000..f713770
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+
+sipcalc $1 |
+sed -n 's/://g ; s/^Expanded.*-.//p' |
+xxd -r -p |
+perl -MMIME::Base32 -ne 'print lc encode_base32 $_; print ".meshname\n"'