-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshubh2
More file actions
27 lines (25 loc) · 750 Bytes
/
shubh2
File metadata and controls
27 lines (25 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
clear
##########Colors###########
NONE='\033[00m'
RED='\033[01;31m'
GREEN='\033[01;32m'
YELLOW='\033[01;33m'
PURPLE='\033[01;35m'
CYAN='\033[01;36m'
##########################
#######Login Details#######
echo -e ${PURPLE} "-----------------------------------------------${GREEN}"
echo " Logged in as:" $(whoami)
sleep 0.5
date | awk '{print " Date & Time:",$1,$2,$3,$4}'
sleep 0.5
last -1 | sed -n 1p | awk '{print " IP Address:",$3}'
sleep 0.5
echo -e ${RED}" " $(last $(whoami) | sed -n 2p | awk '{ print "Last Logged in:", $4,$5,$6,$7}')
sleep 0.5
echo " Failed login attempts :" $(lastb | wc -l)
echo -e ${PURPLE} "-----------------------------------------------"
###########################
echo
echo -e ${NONE}