Added Oh My Posh Script.
This commit is contained in:
parent
3cc0563459
commit
1d03f114e7
13 changed files with 6 additions and 67 deletions
|
@ -1,43 +0,0 @@
|
|||
#!/bin/bash
|
||||
#: <<'END'
|
||||
# RHEL/Fedora rigs
|
||||
RHELHOSTS=("www.schotty.com" "matrix.schotty.com" "shadow.schotty.com")
|
||||
for rhel in "${RHELHOSTS[@]}"
|
||||
do
|
||||
echo "╔═══════════════════════════════════════════════════════════════════════════════════════╗"
|
||||
echo -e "║Host :" $rhel "\t\t\t\t\t\t\t║"
|
||||
expiry=$(
|
||||
echo $rhel |
|
||||
xargs -n 1 bash -c ' \
|
||||
openssl s_client -connect $0:443 2> /dev/null | \
|
||||
openssl x509 -noout -enddate | \
|
||||
cut -d = -f 2 | \
|
||||
xargs -I {} echo {} $0 ')
|
||||
expiry="${expiry:0:24}"
|
||||
echo -e "║SSL Cert Expiry :" ${expiry} "\t\t\t\t\t\t║"
|
||||
echo -e "║System Status :" `ssh $rhel "uptime | awk -F'[a-z]:' '{ print $2}'"` "\t║"
|
||||
echo -e "║Updates :" `ssh $rhel "sudo yum -y list updates | wc -l"`\
|
||||
"\t\t\t\t\t\t\t\t\t║"
|
||||
echo -e "╚═══════════════════════════════════════════════════════════════════════════════════════╝"
|
||||
done
|
||||
#END
|
||||
# Debian based rigs
|
||||
DEBIANHOSTS=("mx.andrewschott.com")
|
||||
for debian in "${DEBIANHOSTS[@]}"
|
||||
do
|
||||
echo "╔═══════════════════════════════════════════════════════════════════════════════════════╗"
|
||||
echo -e "║Host :" $debian "\t\t\t\t\t\t\t║"
|
||||
expiry=$(
|
||||
echo $debian |
|
||||
xargs -n 1 bash -c ' \
|
||||
openssl s_client -connect $0:443 2> /dev/null | \
|
||||
openssl x509 -noout -enddate | \
|
||||
cut -d = -f 2 | \
|
||||
xargs -I {} echo {} $0 ')
|
||||
expiry="${expiry:0:24}"
|
||||
echo -e "║SSL Cert Expiry :" ${expiry} "\t\t\t\t\t\t║"
|
||||
echo -e "║System Status :" `ssh $debian "uptime | awk -F'[a-z]:' '{ print $2}'"` "\t║"
|
||||
echo -e "║Updates :" `ssh $debian "sudo apt update > /dev/null 2>&1;sudo apt-get -s upgrade | grep -P \"\\d\\K upgraded\" | cut -d \" \" -f1" `\
|
||||
"\t\t\t\t\t\t\t\t\t║"
|
||||
echo -e "╚═══════════════════════════════════════════════════════════════════════════════════════╝"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue