Skip to content

Commit bd5f1a2

Browse files
committed
Fix issue with default “yes” when login failed
1 parent feb0e07 commit bd5f1a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/v-log-user-login

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ ip=$2
88
status=$3
99
fingerprint=${4}
1010

11+
active="yes"
12+
if [ $status = "failed" ]; then
13+
active="no"
14+
fi
1115

1216
# Includes
1317
source $HESTIA/func/main.sh
@@ -38,7 +42,7 @@ fi
3842

3943
awk -i inplace -v finger="FINGERPRINT='$fingerprint'" -v active="ACTIVE='no'" '$2 == TIME {$5=ACTIVE}1' $USER_DATA/auth.log
4044

41-
echo "IP='$ip' FINGERPRINT='$fingerprint' STATUS='$status' DATE='$date' TIME='$time' ACTIVE='yes'" >> $USER_DATA/auth.log
45+
echo "IP='$ip' FINGERPRINT='$fingerprint' STATUS='$status' DATE='$date' TIME='$time' ACTIVE='$active'" >> $USER_DATA/auth.log
4246

4347
#----------------------------------------------------------#
4448
# Hestia #

0 commit comments

Comments
 (0)