TrueNAS: Run Script on Startup Run MOTD script

TrueNAS Message of the Day MOTD startup script

For a number of reasons it may be helpful for you to edit the message of the day (MOTD) script that is displayed when you login to your TrueNAS jail. After setting up my VPN as outlined in my TrueNAS: Add VPN Connection to a Jailarticle, I wanted a quick way to ensure that my VPN was still connected and so I opted to write a simple script to have my MOTD display my public IP address. This is a very quick article which will show you how to create an MOTD to display your public ip address.

This is part of my ongoing series of TrueNAS and FreeNAS setup, configuration and install articles.

An updated version of this article is posted on the NEW digiMoot website at:

Create a Script and Run it at Login

First we are going to create a simple script using nano /etc/ipcheck.sh which looks something like this:

#!/bin/bash printf “\\33[0;34mYour public IP address is:\033[0;31m\n” wget -qO – http://wtfismyip.com/text printf “\\033[0m”

As we want this script to be able to run, we need to set securities with chmod to make executable using this command:
chmod +x /etc/ipcheck.sh

Now we will need to add the script to the login file by editing it with this command:
nano ~/.login

In this file, we will add this line:

/bin/sh /etc/ipcheck.sh

That is it. If you log out and back in you should see your public IP address in your login message of the day (MOTD).

Happy TrueNASin’!

~Raze42


2 thoughts on “TrueNAS: Run Script on Startup Run MOTD script

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s