Replace foo=bar
with foo=$(bar) so we comply with GUIDELINES
This commit is contained in:
parent
a99f087e87
commit
eaa2c6b2a3
|
@ -11,7 +11,7 @@ SYSTEME=$(uname -s)
|
||||||
|
|
||||||
test -f /etc/evomaintenance.cf && . /etc/evomaintenance.cf
|
test -f /etc/evomaintenance.cf && . /etc/evomaintenance.cf
|
||||||
|
|
||||||
[ $HOSTNAME ] || HOSTNAME=`hostname`
|
[ $HOSTNAME ] || HOSTNAME=$(hostname)
|
||||||
[ $EVOMAINTMAIL ] || EVOMAINTMAIL=evomaintenance-$(echo $HOSTNAME | cut -d- -f1)@$REALM
|
[ $EVOMAINTMAIL ] || EVOMAINTMAIL=evomaintenance-$(echo $HOSTNAME | cut -d- -f1)@$REALM
|
||||||
|
|
||||||
PATH=$PATH:/usr/sbin
|
PATH=$PATH:/usr/sbin
|
||||||
|
@ -19,16 +19,16 @@ SENDMAIL=$(which sendmail)
|
||||||
# get ipaddress
|
# get ipaddress
|
||||||
|
|
||||||
if [ $SYSTEME = "Linux" ]; then
|
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
|
# get begin_date
|
||||||
BEGIN_YEAR=`date "+%Y"`
|
BEGIN_YEAR=$(date "+%Y")
|
||||||
BEGIN_DATE=`LC_ALL=C who | grep $(ps -o tty= | tail -1) | tr -s ' ' | cut -d" " -f3,4,5`
|
BEGIN_DATE=$(LC_ALL=C who | grep $(ps -o tty= | tail -1) | tr -s ' ' | cut -d" " -f3,4,5)
|
||||||
_USER=$SUDO_USER
|
_USER=$SUDO_USER
|
||||||
elif [ $SYSTEME = "OpenBSD" ]; then
|
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
|
# get begin_date
|
||||||
BEGIN_YEAR=`date "+%Y"`
|
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_DATE=$(LC_ALL=C who | grep $(env | grep SSH_TTY | cut -d"/" -f3) | tr -s ' ' | cut -d" " -f3,4,5)
|
||||||
_USER=$USER
|
_USER=$USER
|
||||||
else
|
else
|
||||||
echo "OS not detected!"
|
echo "OS not detected!"
|
||||||
|
|
Loading…
Reference in a new issue