From 5593186c998c3f63c7abadd3eaa97e55004fc182 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 22 Feb 2026 13:50:59 +0100 Subject: m fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- gotrc-examples/README | 10 +---- gotrc-examples/allow-uppercase | 32 +++++++-------- gotrc-examples/baudrate | 14 +++---- gotrc-examples/cerberus | 8 ++-- gotrc-examples/commands | 82 +++++++++++++++++++-------------------- gotrc-examples/hide-username | 29 +++++++------- gotrc-examples/issue-file | 15 +++---- gotrc-examples/loadkeys | 34 ++++++++-------- gotrc-examples/lower-left-ponysay | 27 ++++++------- gotrc-examples/no-empty-user | 14 +++---- gotrc-examples/readline | 8 ++-- gotrc-examples/revoke-access | 12 +++--- 12 files changed, 127 insertions(+), 158 deletions(-) (limited to 'gotrc-examples') diff --git a/gotrc-examples/README b/gotrc-examples/README index cdd2d29..1ed40e4 100644 --- a/gotrc-examples/README +++ b/gotrc-examples/README @@ -1,15 +1,9 @@ -These are templates you can used for your gotrc file. +These are templates you can use for your gotrc file. If you are happy with them as is, you can include -them directly in your by gotrc file with for example: +them directly in your gotrc file, for example: . /etc/gotrc-examples/no-empty-user Although, it may be better to copy the ones you are using into a directory named /etc/got.d and include them from there. - -If you create any cool or useful extensions yourself -and do not object to licenses them under the GNU -General Public License version 3, please submit them -to . - diff --git a/gotrc-examples/allow-uppercase b/gotrc-examples/allow-uppercase index 3bb0db1..556f137 100644 --- a/gotrc-examples/allow-uppercase +++ b/gotrc-examples/allow-uppercase @@ -2,7 +2,7 @@ # gates-of-tartaros – Minimal replacement for agetty with SSH support # -# Copyright © 2013, 2014, 2015 Mattias Andrée (maandree@member.fsf.org) +# Copyright © 2013, 2014, 2015 Mattias Andrée (m@maandree.se) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,21 +24,19 @@ read_function_allow_uppercase=$read_function read_function=_read_allow_uppercase -_read_allow_uppercase () -{ - $read_function_allow_uppercase - lower="" - for word in $user; do - if [ ! "${word%%-*}" = "" ]; then # This check is done so SSH arguments are not made into lower case - word="$(echo "${word}" | sed -e 'y/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm/')" +_read_allow_uppercase () { + $read_function_allow_uppercase + lower="" + for word in $user; do + if test -n "${word%%-*}"; then # This check is done so SSH arguments are not made into lower case + word="$(echo "${word}" | sed -e 'y/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm/')" + fi + lower="${lower} ${word}" + done + lower="${lower# *}" + if test ! "${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 - lower="${lower} ${word}" - done - lower="${lower# *}" - 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-examples/baudrate b/gotrc-examples/baudrate index 684722f..7fc29aa 100644 --- a/gotrc-examples/baudrate +++ b/gotrc-examples/baudrate @@ -2,7 +2,7 @@ # gates-of-tartaros – Minimal replacement for agetty with SSH support # -# Copyright © 2013, 2014, 2015 Mattias Andrée (maandree@member.fsf.org) +# Copyright © 2013, 2014, 2015 Mattias Andrée (m@maandree.se) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,11 +29,9 @@ display_function_baudrate=$display_function display_function=_display_baudrate -_display_baudrate () -{ - if [ ! "${BAUDRATE}" = "" ]; then - stty ${BAUDRATE} - fi - $display_function_baudrate +_display_baudrate () { + if test -n "${BAUDRATE}"; then + stty ${BAUDRATE} + fi + $display_function_baudrate } - diff --git a/gotrc-examples/cerberus b/gotrc-examples/cerberus index e0761ca..9efa783 100644 --- a/gotrc-examples/cerberus +++ b/gotrc-examples/cerberus @@ -2,7 +2,7 @@ # gates-of-tartaros – Minimal replacement for agetty with SSH support # -# Copyright © 2013, 2014, 2015 Mattias Andrée (maandree@member.fsf.org) +# Copyright © 2013, 2014, 2015 Mattias Andrée (m@maandree.se) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,8 +22,6 @@ # cerberus instead of login -_use_login () -{ - exec cerberus -- "${user}" +_use_login () { + exec cerberus -- "${user}" } - diff --git a/gotrc-examples/commands b/gotrc-examples/commands index 0d57eca..6605884 100644 --- a/gotrc-examples/commands +++ b/gotrc-examples/commands @@ -2,7 +2,7 @@ # gates-of-tartaros – Minimal replacement for agetty with SSH support # -# Copyright © 2013, 2014, 2015 Mattias Andrée (maandree@member.fsf.org) +# Copyright © 2013, 2014, 2015 Mattias Andrée (m@maandree.se) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,42 +24,41 @@ login_function_commands=$login_function login_function=_login_commands -_login_commands () -{ - if [ ! "${user}" = "" ] && [ "${user%%+*}" = "" ]; then - if [ "${user}" = "+shutdown" ]; then - shutdown -h now - elif [ "${user}" = "+reboot" ]; then - reboot - elif [ "${user}" = "+time" ]; then - echo - date +%Y-\(%m\)%b-%d\ %T,\ %a\ w%W/%V,\ %Z - read __ - elif [ "${user}" = "+battery" ]; then - echo - acpi -V - read __ - elif [ "${user}" = "+backlight" ]; then - if [ "${LANG%UTF-8*}" = "${LANG}" ]; then - export LANG="en_GB.UTF-8" - fi - adjbacklight - elif [ "${user}" = "+keyboard" ]; then - echo "Enter keyboard layout: (e.g. sv-latin1)" - read -r layout - if [ ! "$(echo ${layout})" = "" ]; then - loadkeys -C "/dev/${tty}" -- ${layout} - if [ ! $? = 0 ]; then - echo 'Press ENTER to continue...' - read - fi - fi - elif [ "${user}" = "+1" ]; then - echo "Enter parameters: (e.g. tty7 TERM=linux)" - read -r params - setsid -- "$0" $params & - else - cat <