https://github.com/rtulke/dynmotd
Dynamic Motd (Message of the Day)
https://github.com/rtulke/dynmotd
bash bash-script dynamic logging login-screen maintenance maintenance-mode message-of-the-day motd motd-message shell shell-script
Last synced: 4 months ago
JSON representation
Dynamic Motd (Message of the Day)
- Host: GitHub
- URL: https://github.com/rtulke/dynmotd
- Owner: rtulke
- Created: 2015-09-07T10:52:11.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2025-05-05T21:10:22.000Z (5 months ago)
- Last Synced: 2025-05-05T22:23:29.921Z (5 months ago)
- Topics: bash, bash-script, dynamic, logging, login-screen, maintenance, maintenance-mode, message-of-the-day, motd, motd-message, shell, shell-script
- Language: Shell
- Homepage:
- Size: 632 KB
- Stars: 50
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dynmotd
Dynamic Motd (Message of the Day) an script that outputs some system-specific information.
# Useful Functions
* easy to create own color schemes
* enabling or disabling information sections
* specific system description for each system
* maintenance logging
* only one shell script
* multi OS support
* easily extendable
* less dependenciesNew features comming soon
* better Multi OS support
* GeoIP Information
* Weather Information
* NewsFeeder?# Tested Linux Distributions
| Distribution | Status |
|--------------------|----------------------|
| CentOS 8 - 9 | Successfully tested |
| Debian 8 - 12 | Successfully tested |
| Ubuntu 18 - 23.10 | Successfully tested |
| Fedora 38 - 39 | Successfully tested |
| Rocky Linux 8 - 9 | Successfully tested |
| Raspberry Pi OS | Successfully tested |Tell me if you have tested it on an OS that is not on the list.
Pre-Setup Debian, Raspberry PI OS and Ubuntu and all other Debian based Distributions
-------------------------------------------------------------------------------------Install default packages:
~~~
apt update && apt upgrade
apt install coreutils bc procps hostname sed mawk grep bind9-host lsb-release git
~~~Pre-Setup CentOS, Rocky Linux and RedHat
----------------------------------------Install default packages:
~~~
yum install bc bind-utils redhat-lsb-core git
~~~Alma Linux
----------Install default packages:
~~~
dnf install bc git bind-utils almalinux-release
~~~Installation
------------Script runs only as root.
~~~
sudo -i
git clone https://github.com/rtulke/dynmotd.git
cd dynmotd
./dynmotd.sh --install
~~~To test dynmotd properly, you should log out of the system and log in again.
If you have logged in directly via ssh root, log in to the server again.~~~
exit
sudo -i
~~~Parameter
---------~~~
Usage: dynmotd [-c|-a|-d|--install|--help]e.g. dynmotd -a "start web migration"
Parameter:
-a | addlog | --addlog "..." add new log entry
-d | rmlog | --rmlog [loglinenumber] delete a specific log entry by using -l to identify the line number
-l | log | --log list log entries
-c | config | --config restart setup
-i | install | --install install dynmotd
-u | uninstall | --uninstall uninstall dynmotd
~~~Some dynmotd Options
--------------------~~~
vim /usr/local/bin/dynmotd
~~~You can enable or disable information blocks
~~~
## enable system related information about your system
SYSTEM_INFO="1" # show system information
STORAGE_INFO="1" # show storage information
USER_INFO="1" # show some user infomration
ENVIRONMENT_INFO="1" # show environement information
MAINTENANCE_INFO="1" # show maintenance information
UPDATE_INFO="0" # show update information, deactivate when using redhat
VERSION_INFO="1" # show the version banner
~~~* 1 = enable
* 0 = disableYou can also change the number of log lines displayed by changing "LIST_LOG_ENTRY".
~~~
LIST_LOG_ENTRY="5"
~~~Known Issues
------------### The FQDN or hostname or IP Address is not displayed correctly?
The FQDN Full Qualified Domain Name is not displayed correctly if it has not been made known to the system in the /etc/hostname file. In this case, the matching exposed IP cannot be displayed correctly either.Example: The command: `hostname --fqdn` produces the following output:
~~~
~~~This is probably due to the fact that only "mail" has been entered in the /etc/hostname file.
This can be remedied as follows:
~~~
hostname subdomain.domain.tld
hostname >/etc/hostname
~~~Example:
~~~
hostname mail.linux-hub.ch
hostname >/etc/hostname
~~~You can check it with the following command.
~~~
hostname --fqdn
mail.linux-hub.ch
~~~check also the `/etc/hosts` entry
~~~
127.0.1.1 mail.linux-hub.ch
~~~### UPDATE_INFO="1" displays errors
When I have activated UPDATE_INFO="1" I get errors. This may be because you are not working on a Debian based system. If you are not working on a Debian based system you should set the option UPDATE_INFO="0" so that this info block is not displayed. Maybe this will be a feature for the future.### In "User Data" info block, SshKeyRootUsers shows "- Unkown -"
This always happens if the SSH key has no comment that indicates which SSH key it is. To fix the problem, you either have to enter an additional name or e-mail address at the end of the key in the ~/.ssh/authorized_keys file using a space or create your SSH keys with ssh-keygen -C "YourNameHere"