Jump to content

Login Message and Weather - Clean and Shiny!


Recommended Posts

Hello,

Whenever i logged in on my test-server i wanted to be more like X-Men movies (Welcome Professor!!! famous quote), so i wanted to create a human friendly environment, of course you can modify this to your needs, but this is my script that i want to share with you.

Final result will be this:

 

 

220258Ht4Ifab.png

 

What does it do:

Only after you successfully login in FreeBSD it will:

  1. Clear console so it will be clean and shiny!
  2. Print a welcome message.
  3. Print weather automatically parsed from your location (you need to set your location, i will show you how, it is very easy).
  4. Change directory (cd) to your desirable location (in my case i wanted to change directory in my start.sh location so i don't have to make the same command every time i login.).

Of course you can do whatever else you want it to do.

How to make this happen:

  1. Login
  2. press the following command
ee ~/.login

Notice that this command is not guaranteed to work on every FreeBSD version but should work on most cases

Append the following commands:

cd /usr/home/game #Where the change directory should go
clear #Clear console after login
echo "Welcome $USER!" #Welcome message ($USER variable is the current user logged in)
curl -s http://wttr.in/thessaloniki | head -7 | tail -5 #This is the weather info, change "thessaloniki" with the city of your choice.

Now press ctrl + C and "exit" (Without quotes, this will save the above information and exit to command line.).

Now reboot or logout and login again and see the difference, much cleaner, isn't it?

  • Love 8
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.