Last active
August 29, 2015 14:02
-
-
Save LibertyBeta/a92286a486b2d7504c49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set head " | |
____ _____ __ _ | |
/ __ \____ ____ / ___/___ ____ ____/ /___ _(_) | |
/ / / / __ \/ __ \ \__ \/ _ \/ __ \/ __ / __ `/ / | |
/ /_/ / / / / /_/ / ___/ / __/ / / / /_/ / /_/ / / | |
\________/_/\____/ /____/\_____/ /_/\__,_/\__,_/_/ _____ | |
/ ____/_ __/ /_ ___ _____/ /_ ___ ____________ __ |__ / | |
/ / / / / / __ \/ _ \/ ___/ __ \/ _ \/ ___/ ___/ / / / /_ < | |
/ /___/ /_/ / /_/ / __/ / / /_/ / __/ / / / / /_/ / ___/ / | |
\____/\__, /_.___/\___/_/ /_.___/\___/_/ /_/ \__, / /____/ | |
/____/ /____/ | |
---------------------------------------------------------------------" | |
set var(user) $env(USER) | |
# * Calculate last login | |
set lastlog [exec -- lastlog -u $var(user)] | |
set ll(1) [lindex $lastlog 7] | |
set ll(2) [lindex $lastlog 8] | |
set ll(3) [lindex $lastlog 9] | |
set ll(4) [lindex $lastlog 10] | |
set ll(5) [lindex $lastlog 6] | |
# * Calculate current system uptime | |
set uptime [exec -- /usr/bin/cut -d. -f1 /proc/uptime] | |
set up(days) [expr {$uptime/60/60/24}] | |
set up(hours) [expr {$uptime/60/60%24}] | |
set up(mins) [expr {$uptime/60%60}] | |
set up(secs) [expr {$uptime%60}] | |
# * Calculate SSH logins: | |
set logins [exec -- w -s] | |
set log(c) [lindex $logins 5] | |
puts "\033\[01;32m$head\033\[0;33m" | |
puts " \033\[35mLast Login....:\033\[0m \033\ $ll(1) $ll(2) $ll(3) $ll(4) from $ll(5)\033\[0m" | |
puts " \033\[35mUptime........:\033\[0m \033\ $up(days)days $up(hours)hours $up(mins)minutes $up(secs)seconds\033\[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment