don't duplicate lines
This commit is contained in:
parent
eaa2c6b2a3
commit
869b03b018
|
@ -18,16 +18,14 @@ PATH=$PATH:/usr/sbin
|
|||
SENDMAIL=$(which sendmail)
|
||||
# get ipaddress
|
||||
|
||||
BEGIN_YEAR=$(date "+%Y")
|
||||
|
||||
if [ $SYSTEME = "Linux" ]; then
|
||||
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)
|
||||
_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/)$//")
|
||||
# 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)
|
||||
_USER=$USER
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue