I hope it is ok to ask such a question here.
In Linux Debian, I am able to execute the $SSH_CONNECTION command in a terminal window, as well as a terminal execution of a script (./test.sh) and it returns both the connecting and local IP addresses.
echo $SSH_CONNECTION | awk '{ print $1" "$3}'
However, when execute the ./test.sh with a cron job, the script will not return the IP addresses. It seems that I need an 'export PATH=$PATH:...' in my script, but after trying almost every path concerning OpsnSSL, it still doesn't return the IPs.
Any suggestions will be appreciated. LinuxQuestions couldn't come up with an answer.
Thanks.