Replace foo=bar with foo=$(bar) so we comply with GUIDELINES

This commit is contained in:
Daniel Jakots 2016-12-08 16:46:31 +01:00
parent a99f087e87
commit eaa2c6b2a3

View file

@ -11,7 +11,7 @@ SYSTEME=$(uname -s)
test -f /etc/evomaintenance.cf && . /etc/evomaintenance.cf
[ $HOSTNAME ] || HOSTNAME=`hostname`
[ $HOSTNAME ] || HOSTNAME=$(hostname)
[ $EVOMAINTMAIL ] || EVOMAINTMAIL=evomaintenance-$(echo $HOSTNAME | cut -d- -f1)@$REALM
PATH=$PATH:/usr/sbin
@ -19,16 +19,16 @@ SENDMAIL=$(which sendmail)
# get ipaddress
if [ $SYSTEME = "Linux" ]; then
IP=`LC_ALL=C who | grep $(ps -o tty= | tail -1) | tr -s ' ' | cut -d" " -f6 | sed -e "s/^(// ; s/)$//"`
IP=$(LC_ALL=C who | grep $(ps -o tty= | tail -1) | tr -s ' ' | cut -d" " -f6 | sed -e "s/^(// ; s/)$//")
# get begin_date
BEGIN_YEAR=`date "+%Y"`
BEGIN_DATE=`LC_ALL=C who | grep $(ps -o tty= | tail -1) | tr -s ' ' | cut -d" " -f3,4,5`
BEGIN_YEAR=$(date "+%Y")
BEGIN_DATE=$(LC_ALL=C who | grep $(ps -o tty= | tail -1) | tr -s ' ' | cut -d" " -f3,4,5)
_USER=$SUDO_USER
elif [ $SYSTEME = "OpenBSD" ]; then
IP=`LC_ALL=C who | grep $(env | grep SSH_TTY | cut -d"/" -f3) | tr -s ' ' | cut -d" " -f6 | sed -e "s/^(// ; s/)$//"`
IP=$(LC_ALL=C who | grep $(env | grep SSH_TTY | cut -d"/" -f3) | tr -s ' ' | cut -d" " -f6 | sed -e "s/^(// ; s/)$//")
# get begin_date
BEGIN_YEAR=`date "+%Y"`
BEGIN_DATE=`LC_ALL=C who | grep $(env | grep SSH_TTY | cut -d"/" -f3) | tr -s ' ' | cut -d" " -f3,4,5`
BEGIN_YEAR=$(date "+%Y")
BEGIN_DATE=$(LC_ALL=C who | grep $(env | grep SSH_TTY | cut -d"/" -f3) | tr -s ' ' | cut -d" " -f3,4,5)
_USER=$USER
else
echo "OS not detected!"