From 5b1bec7ba23c02c9e63b25c63b638bacc239ce56 Mon Sep 17 00:00:00 2001
From: Daniil Baturin <daniil@baturin.org>
Date: Sat, 19 Dec 2015 04:59:19 +0100
Subject: Easter egg: 'show version funny' command that displays limericks
 after version information.

---
 Makefile.am                           |  1 +
 scripts/limericks.py                  | 51 +++++++++++++++++++++++++++++++++++
 templates/show/version/funny/node.def |  5 ++++
 3 files changed, 57 insertions(+)
 create mode 100644 scripts/limericks.py
 create mode 100644 templates/show/version/funny/node.def

diff --git a/Makefile.am b/Makefile.am
index 410c419..e736419 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,6 +52,7 @@ bin_SCRIPTS += scripts/vyatta-monitor-check-rule-log
 bin_SCRIPTS += scripts/vyos-show-ram.sh
 bin_SCRIPTS += scripts/vyos-strip-config.pl
 bin_SCRIPTS += scripts/maya-date.py
+bin_SCRIPTS += scripts/limericks.py
 
 sbin_SCRIPTS     = scripts/dhcpv6-client-show-leases.pl
 sbin_SCRIPTS    += scripts/vyatta-image-tools.pl
diff --git a/scripts/limericks.py b/scripts/limericks.py
new file mode 100644
index 0000000..acb1a74
--- /dev/null
+++ b/scripts/limericks.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+import random
+
+limericks = [
+
+"""
+A programmer who's name was Searle
+Once wrote a long program in Perl.
+Despite very few quirks
+No one got how it works,
+Not even the interpreter.
+""",
+
+"""
+There was a young lady of Maine
+Who set up IPsec VPN.
+Problems didn't arise
+'til other vendors' device
+had to add she to that VPN.
+""",
+
+"""
+One day a programmer from York
+started his own Vyatta fork.
+Though he was a huge geek,
+it still took him a week
+to get the damn build scripts to work.
+""",
+
+"""
+A network admin from Hong Kong
+knew MPPE cipher's not strong.
+But he was behind NAT,
+so he put up we that,
+sad network admin from Hong Kong.
+""",
+
+"""
+A network admin named Drake
+greeted friends with a three-way handshake
+and refused to proceed
+if they didn't complete it,
+that standards-compliant guy Drake.
+"""
+
+]
+
+l = limericks[random.randint(0, len(limericks) - 1)]
+
+print(l)
diff --git a/templates/show/version/funny/node.def b/templates/show/version/funny/node.def
new file mode 100644
index 0000000..cb62c96
--- /dev/null
+++ b/templates/show/version/funny/node.def
@@ -0,0 +1,5 @@
+help: Show VyOS version information plus a funny poem
+run:
+    ${vyatta_bindir}/vyatta-show-version
+    ${vyatta_bindir}/limericks.py
+
-- 
cgit v1.2.3