What is a welcome script?
A welcome script is something that is displayed upon logging in to a server. This may include a MOTD, server statistics, etc.
I’ve created a BASH welcome script called shwelcome.
shwelcome uses a modular approach which allows you to customize/create your own modules. By default it includes the following modules:
- cowsayfortune: prints fortune inside a cowsay bubble
- summary: prints general system info/welcome message
- taskwarrior: prints current task list
What does it look like?
An example of the output that shwelcome produces below:
How do I install it?
You can either follow the instructions below, or you can visit the official Github repo for shwelcome.
A. Install the required dependencies
2. Install the required packages
yum install fortune-mod cowsay task git -y
B. Install the shwelcome script
1. Clone the shwelcome repo to your preferred directory (eg: /opt)
cd /opt && git clone https://github.com/centosblog/shwelcome
2. Ensure shwelcome/shwelcome.sh is executable
chmod +x /opt/shwelcome/shwelcome.sh
3. Enable it to run upon login for your user by adding /opt/shwelcome/shwelcome.sh to your profile file, eg: ~/.bash_profile (BASH) or ~/.zshrc (ZSH)
4. (Optional) Enable it globally for all users by adding /opt/shwelcome/shwelcome.sh to your shell’s default profile, eg: /etc/zshrc (ZSH)
Test that it runs as expected by logging in to your server. If you have any questions, feedback or queries in general, please feel free to leave a comment!