Merge pull request #53 from stealthcopter/master
Added checks to list running containers
This commit is contained in:
commit
410eaedbbd
@ -896,6 +896,26 @@ if [ "`echo $CHECKS | grep SysI`" ]; then
|
||||
else echo_no
|
||||
fi
|
||||
|
||||
#-- ????) Containers Running
|
||||
printf $Y"[+] "$GREEN"Any running containers? ........ "$NC
|
||||
# Get counts of running containers for each platform
|
||||
dockercontainers=`docker ps --format "{{.Names}}" 2>/dev/null | wc -l`
|
||||
lxccontainers=`lxc list -c n --format csv 2>/dev/null | wc -l`
|
||||
rktcontainers=`rkt list 2>/dev/null | tail -n +2 | wc -l`
|
||||
if [ "$dockercontainers" -eq "0" ] && [ "$lxccontainers" -eq "0" ] && [ "$rktcontainers" -eq "0" ]; then
|
||||
echo_no
|
||||
else
|
||||
containerCounts=""
|
||||
if [ "$dockercontainers" -ne "0" ]; then containerCounts="${containerCounts}docker($dockercontainers) "; fi
|
||||
if [ "$lxccontainers" -ne "0" ]; then containerCounts="${containerCounts}lxc($lxccontainers) "; fi
|
||||
if [ "$rktcontainers" -ne "0" ]; then containerCounts="${containerCounts}rkt($rktcontainers) "; fi
|
||||
echo "Yes $containerCounts" | sed "s,.*,${C}[1;31m&${C}[0m,"
|
||||
# List any running containers
|
||||
if [ "$dockercontainers" -ne "0" ]; then echo "Running Docker Containers" | sed "s,.*,${C}[1;31m&${C}[0m,"; docker ps | tail -n +2 2>/dev/null; echo ""; fi
|
||||
if [ "$lxccontainers" -ne "0" ]; then echo "Running LXC Containers" | sed "s,.*,${C}[1;31m&${C}[0m,"; lxc list 2>/dev/null; echo ""; fi
|
||||
if [ "$rktcontainers" -ne "0" ]; then echo "Running RKT Containers" | sed "s,.*,${C}[1;31m&${C}[0m,"; rkt list 2>/dev/null; echo ""; fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
if [ "$WAIT" ]; then echo "Press enter to continue"; read "asd"; fi
|
||||
@ -931,7 +951,7 @@ if [ "`echo $CHECKS | grep AvaSof`" ]; then
|
||||
|
||||
#-- 1AS) Useful software
|
||||
printf $Y"[+] "$GREEN"Useful software\n"$NC
|
||||
which nmap aws nc ncat netcat nc.traditional wget curl ping gcc g++ make gdb base64 socat python python2 python3 python2.7 python2.6 python3.6 python3.7 perl php ruby xterm doas sudo fetch docker 2>/dev/null
|
||||
which nmap aws nc ncat netcat nc.traditional wget curl ping gcc g++ make gdb base64 socat python python2 python3 python2.7 python2.6 python3.6 python3.7 perl php ruby xterm doas sudo fetch docker lxc rkt kubectl 2>/dev/null
|
||||
echo ""
|
||||
|
||||
#-- 2AS) Search for compilers
|
||||
|
Loading…
Reference in New Issue
Block a user