From 6fd5ced67b280ac2e22ff17d3319631c4e805a17 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 30 Sep 2013 19:06:37 +0200 Subject: add gotrc that restarts got if the user line is left empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 2 +- gotrc-examples/no-empty-user | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 gotrc-examples/no-empty-user diff --git a/Makefile b/Makefile index 657b2e2..44a5361 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ SSH = ssh BASH_SHEBANG = /usr/bin/env bash -EXAMPLES = lower-left-ponysay allow-uppercase issue-file commands +EXAMPLES = lower-left-ponysay allow-uppercase issue-file commands no-empty-user diff --git a/gotrc-examples/no-empty-user b/gotrc-examples/no-empty-user new file mode 100644 index 0000000..4f50033 --- /dev/null +++ b/gotrc-examples/no-empty-user @@ -0,0 +1,16 @@ +# -*- shell-script -*- + +# The module restarts gates-of-tartaros is the user line is left empty + + +read_function_no_empty_user=$read_function +read_function=_read_no_empty_user + +function _read_no_empty_user +{ + $read_function_no_empty_user + if ["${lower}" = "" ]; then + exit 0 + fi +} + -- cgit v1.2.3-70-g09d2