aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-09-30 19:06:37 +0200
committerMattias Andrée <maandree@operamail.com>2013-09-30 19:06:37 +0200
commit6fd5ced67b280ac2e22ff17d3319631c4e805a17 (patch)
tree7cc35721b6debd5073e09c91004c2d64ecad3cd3
parentgot does not spawn itself to get login to work (diff)
downloadgates-of-tartaros-6fd5ced67b280ac2e22ff17d3319631c4e805a17.tar.gz
gates-of-tartaros-6fd5ced67b280ac2e22ff17d3319631c4e805a17.tar.bz2
gates-of-tartaros-6fd5ced67b280ac2e22ff17d3319631c4e805a17.tar.xz
add gotrc that restarts got if the user line is left empty
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--Makefile2
-rw-r--r--gotrc-examples/no-empty-user16
2 files changed, 17 insertions, 1 deletions
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
+}
+