mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 12:32:12 +00:00
tweaking
This commit is contained in:
parent
d919d063e4
commit
6b0d07c6bd
5 changed files with 29 additions and 7 deletions
28
bin/dps.sh
28
bin/dps.sh
|
@ -1,9 +1,18 @@
|
||||||
#/bin/bash
|
#/bin/bash
|
||||||
# Show current status of all running containers
|
# Show current status of T-Pot containers
|
||||||
myPARAM="$1"
|
myPARAM="$1"
|
||||||
|
myCONTAINERS="$(cat /opt/tpot/etc/tpot.yml | grep -v '#' | grep container_name | cut -d: -f2 | sort | tr -d " ")"
|
||||||
|
myRED="[1;31m"
|
||||||
|
myGREEN="[1;32m"
|
||||||
|
myBLUE="[1;34m"
|
||||||
|
myWHITE="[0;0m"
|
||||||
|
myMAGENTA="[1;35m"
|
||||||
|
|
||||||
|
function fuGETSTATUS {
|
||||||
|
grc docker ps -f status=running -f status=exited --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep -v "NAME" | sort
|
||||||
|
}
|
||||||
|
|
||||||
function fuGETSYS {
|
function fuGETSYS {
|
||||||
echo
|
|
||||||
printf "========| System |========\n"
|
printf "========| System |========\n"
|
||||||
printf "%+10s %-20s\n" "Date: " "$(date)"
|
printf "%+10s %-20s\n" "Date: " "$(date)"
|
||||||
printf "%+10s %-20s\n" "Uptime: " "$(uptime | cut -b 2-)"
|
printf "%+10s %-20s\n" "Uptime: " "$(uptime | cut -b 2-)"
|
||||||
|
@ -13,8 +22,21 @@ echo
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
|
myDPS=$(fuGETSTATUS)
|
||||||
|
myDPSNAMES=$(echo "$myDPS" | awk '{ print $1 }' | sort)
|
||||||
fuGETSYS
|
fuGETSYS
|
||||||
grc docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
|
printf "%-21s %-28s %s\n" "NAME" "STATUS" "PORTS"
|
||||||
|
if [ "$myDPS" != "" ];
|
||||||
|
then
|
||||||
|
echo "$myDPS"
|
||||||
|
fi
|
||||||
|
for i in $myCONTAINERS; do
|
||||||
|
myAVAIL=$(echo "$myDPSNAMES" | grep -o "$i" | uniq | wc -l)
|
||||||
|
if [ "$myAVAIL" = "0" ];
|
||||||
|
then
|
||||||
|
printf "%-28s %-28s\n" "$myRED$i" "DOWN$myWHITE"
|
||||||
|
fi
|
||||||
|
done
|
||||||
if [[ $myPARAM =~ ^([1-9]|[1-9][0-9]|[1-9][0-9][0-9])$ ]];
|
if [[ $myPARAM =~ ^([1-9]|[1-9][0-9]|[1-9][0-9][0-9])$ ]];
|
||||||
then
|
then
|
||||||
sleep "$myPARAM"
|
sleep "$myPARAM"
|
||||||
|
|
|
@ -42,7 +42,7 @@ services:
|
||||||
|
|
||||||
# Conpot IEC104 service
|
# Conpot IEC104 service
|
||||||
conpot_IEC104:
|
conpot_IEC104:
|
||||||
container_name: conpot_IEC104
|
container_name: conpot_iec104
|
||||||
restart: always
|
restart: always
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -52,7 +52,7 @@ services:
|
||||||
|
|
||||||
# Conpot IEC104 service
|
# Conpot IEC104 service
|
||||||
conpot_IEC104:
|
conpot_IEC104:
|
||||||
container_name: conpot_IEC104
|
container_name: conpot_iec104
|
||||||
restart: always
|
restart: always
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -42,7 +42,7 @@ services:
|
||||||
|
|
||||||
# Conpot IEC104 service
|
# Conpot IEC104 service
|
||||||
conpot_IEC104:
|
conpot_IEC104:
|
||||||
container_name: conpot_IEC104
|
container_name: conpot_iec104
|
||||||
restart: always
|
restart: always
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -42,7 +42,7 @@ services:
|
||||||
|
|
||||||
# Conpot IEC104 service
|
# Conpot IEC104 service
|
||||||
conpot_IEC104:
|
conpot_IEC104:
|
||||||
container_name: conpot_IEC104
|
container_name: conpot_iec104
|
||||||
restart: always
|
restart: always
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
environment:
|
environment:
|
||||||
|
|
Loading…
Reference in a new issue