tpotce/bin/dps.sh
Marco Ochse c2baf27761 speed up dps.sh
grc now supports docker, use it to colorize docker ps output without any dependencies to *.yml
2018-06-11 12:50:18 +00:00

24 lines
591 B
Bash
Executable file

#/bin/bash
# Show current status of all running containers
myPARAM="$1"
function fuGETSYS {
echo
printf "========| System |========\n"
printf "%+10s %-20s\n" "Date: " "$(date)"
printf "%+10s %-20s\n" "Uptime: " "$(uptime | cut -b 2-)"
printf "%+10s %-20s\n" "CPU temp: " "$(sensors | grep 'Physical' | awk '{ print $4" " }' | tr -d [:cntrl:])"
echo
}
while true
do
fuGETSYS
grc docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
if [[ $myPARAM =~ ^([1-9]|[1-9][0-9]|[1-9][0-9][0-9])$ ]];
then
sleep "$myPARAM"
else
break
fi
done