aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile13
-rw-r--r--README4
-rw-r--r--gotrc-examples/allow-uppercase17
-rw-r--r--gotrc-examples/lower-left-ponysay (renamed from gotrc)0
4 files changed, 28 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 2d9c015..555021f 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ SSH = ssh
BASH_SHEBANG = /usr/bin/env bash
+EXAMPLES = lower-left-ponysay allow-uppercase
+
.PHONY: all
@@ -60,13 +62,20 @@ got-cmd.install: got-cmd
install: install-cmd install-doc
.PHONY: install-cmd
-install-cmd: got.install got-cmd.install
+install-cmd: install-core
+
+.PHONY: install-core install-examples
+install-core: got.install got-cmd.install
install -Dm755 -- "got.install" "$(DESTDIR)$(PREFIX)$(SBIN)/got"
install -Dm755 -- "got-cmd.install" "$(DESTDIR)$(PREFIX)$(BIN)/got-cmd"
- install -Dm644 -- "gotrc" "$(DESTDIR)$(SYSCONF)/gotrc.examples/lower-left-ponysay"
install -d -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)"
install -m644 -- COPYING LICENSE "$(DESTDIR)$(LICENSES)/$(PKGNAME)"
+.PHONY: install-examples
+install-examples: $(foreach EXAMPLE, $(EXAMPLES), gotrc-examples/$(EXAMPLE))
+ install -d -- "$(DESTDIR)$(SYSCONF)/gotrc.examples"
+ install -m644 -- $^ "$(DESTDIR)$(SYSCONF)/gotrc.examples"
+
.PHONY: install-doc
install-doc: install-info
diff --git a/README b/README
index f6d7d33..ae1532a 100644
--- a/README
+++ b/README
@@ -1,10 +1,6 @@
Minimal replacement for agetty written in
GNU Bash with support for remote SSH login.
-An example /etc/gotrc file is included,
-it requires ponysay, util-say and KMS
-support, and prints a random pony.
-
To log in with over SSH type:
user@host
or
diff --git a/gotrc-examples/allow-uppercase b/gotrc-examples/allow-uppercase
new file mode 100644
index 0000000..858fee0
--- /dev/null
+++ b/gotrc-examples/allow-uppercase
@@ -0,0 +1,17 @@
+# -*- shell-script -*-
+
+
+read_function_allow_uppercase=$read_function
+read_function=_read_allow_uppercase
+
+function _read_allow_uppercase
+{
+ $read_function_allow_uppercase
+ lower="$(sed -e 'y/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm' <<< "${user}")"
+ if [ ! "${lower}" = "${user}" ]; then
+ #stty olcuc ## Uncomment this if you want to go old-school Unix, too bad
+ ## it will break colours and only uppercases ASCII letters.
+ user="${lower}"
+ fi
+}
+
diff --git a/gotrc b/gotrc-examples/lower-left-ponysay
index 563790d..563790d 100644
--- a/gotrc
+++ b/gotrc-examples/lower-left-ponysay