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.
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:
In this file, we will add this line:
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).