Jump to content
Science Forums

Subtle hinting with motd


Recommended Posts

So linux has this great fun feature for admins called motd, its just message of the day, and its a file in /etc that gets catted on user login. So, me being subtle me, i decided to put something actually useful in motd, to hint to users that they should not leave random screen sessions open all the time, and ended with writing this small bash script to make it all happen

[noparse]
echo -e "033[1;31m***************************************************************************************************033[0m" > motd
echo -e "033[1;31m*033[0m                                          033[1;31m[sCREEN]033[0m                                               033[1;31m*033[0m" >> motd
echo -e "033[1;31m*                                                                                                 *033[0m" >> motd
echo -e "033[1;31m*033[0m 033[1;35m{commands}033[0m                                                                                      033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mscreen -list  - lists screen sessions033[0m                                                           033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mscreen -r [name] or screen -r [id]  - reattaches to a detached screen session033[0m                   033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mscreen -x [name] or screen -x [id]  - reattaches to any screen session033[0m                          033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mscreen -dmS [name]  - start a detached screen session (named)033[0m                                   033[1;31m*033[0m" >> motd 
echo -e "033[1;31m*                                                                                                 *033[0m" >> motd
echo -e "033[1;31m*033[0m 033[1;35m{shortcuts}033[0m                                                                                     033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl d  - logout of current screen and kill it033[0m                                                  033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + d  - detatch from a screen session (what you should do most of the time)033[0m               033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + c  - create new window033[0m                                                                 033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + "  - list windows in current screen (select switch)033[0m                                    033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + a  - quickly switch to the next window in current screen033[0m                               033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + # (0-9)  - switch to a specific screen033[0m                                                 033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + ?  - help033[0m                                                                              033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + S  - split screen033[0m                                                                      033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + TAB  - switch between split screens033[0m                                                    033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + Q (yes capital)  - kill all split screens but the current one (this keeps the windows)033[0m 033[1;31m*033[0m" >> motd
echo -e "033[1;31m*033[0m 033[0;37mCtrl a + X  - remove current window from split033[0m                                                  033[1;31m*033[0m" >> motd
echo -e "033[1;31m*                                                                                                 *033[0m" >> motd
echo -e "033[1;31m***************************************************************************************************033[0m" >> motd[/noparse]

generages a perdy motd of this sort:

post-472-128210107484_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...