From 0aa7865e4208be490722c7a76c5b55a5438de1ed Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Mon, 29 Aug 2016 23:24:25 +0000 Subject: [PATCH] tweaking --- installer/bin/dps.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/installer/bin/dps.sh b/installer/bin/dps.sh index 94a93064..1b0e9748 100755 --- a/installer/bin/dps.sh +++ b/installer/bin/dps.sh @@ -1,4 +1,6 @@ #/bin/bash +stty -echo -icanon time 0 min 0 +myIMAGES=$(cat /data/images.conf) while true do clear @@ -7,11 +9,24 @@ while true echo Uptime:" "$(uptime) echo CPU temp: $(sensors | grep "Physical" | awk '{ print $4 }') echo - /usr/bin/docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" -f status=running -f status=exited | GREP_COLORS='mt=01;35' /bin/egrep --color=always "(^[_a-z-]+ |$)|$" | GREP_COLORS='mt=01;32' /bin/egrep --color=always "(Up[ 0-9a-Z ]+ |$)|$" | GREP_COLORS='mt=01;31' /bin/egrep --color=always "(Exited[ \(0-9\) ]+ [0-9a-Z ]+ ago|$)|$" - if [ "$1" = "" ]; - then - break; - else - sleep $1 - fi + echo "NAME CREATED PORTS" + for i in $myIMAGES; do + /usr/bin/docker ps -f name=$i --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" -f status=running -f status=exited | GREP_COLORS='mt=01;35' /bin/egrep --color=always "(^[_a-z-]+ |$)|$" | GREP_COLORS='mt=01;32' /bin/egrep --color=always "(Up[ 0-9a-Z ]+ |$)|$" | GREP_COLORS='mt=01;31' /bin/egrep --color=always "(Exited[ \(0-9\) ]+ [0-9a-Z ]+ ago|$)|$" | tail -n 1 + if [ "$1" = "vv" ]; + then + /usr/bin/docker exec -t $i /bin/ps -awfuwfxwf | egrep -v -E "awfuwfxwf|/bin/ps" + fi + done + if [[ $1 =~ ^([1-9]|[1-9][0-9]|[1-9][0-9][0-9])$ ]]; + then + sleep $1 + else + break + fi + read myKEY + if [ "$myKEY" == "q" ]; + then + break; + fi done +stty sane