diff --git a/bin/dps.sh b/bin/dps.sh index 426c510a..173294ec 100755 --- a/bin/dps.sh +++ b/bin/dps.sh @@ -1,47 +1,9 @@ #/bin/bash # Show current status of all running containers myPARAM="$1" -myIMAGES="$(cat /opt/tpot/etc/tpot.yml | grep -v '#' | grep container_name | cut -d: -f2)" -myRED="" -myGREEN="" -myBLUE="" -myWHITE="" -myMAGENTA="" - -function fuCONTAINERSTATUS { -local myNAME="$1" -local mySTATUS="$(/usr/bin/docker ps -f name=$myNAME --format "table {{.Status}}" -f status=running -f status=exited | tail -n 1)" -myDOWN="$(echo "$mySTATUS" | grep -o -E "(STATUS|NAMES|Exited)")" - -case "$myDOWN" in - STATUS) - mySTATUS="$myRED"DOWN"$myWHITE" - ;; - NAMES) - mySTATUS="$myRED"DOWN"$myWHITE" - ;; - Exited) - mySTATUS="$myRED$mySTATUS$myWHITE" - ;; - *) - mySTATUS="$myGREEN$mySTATUS$myWHITE" - ;; -esac - -printf "$mySTATUS" -} - -function fuCONTAINERPORTS { -local myNAME="$1" -local myPORTS="$(/usr/bin/docker ps -f name=$myNAME --format "table {{.Ports}}" -f status=running -f status=exited | tail -n 1 | sed s/","/",\n\t\t\t\t\t\t\t"/g)" - -if [ "$myPORTS" != "PORTS" ]; - then - printf "$myBLUE$myPORTS$myWHITE" -fi -} function fuGETSYS { +echo printf "========| System |========\n" printf "%+10s %-20s\n" "Date: " "$(date)" printf "%+10s %-20s\n" "Uptime: " "$(uptime | cut -b 2-)" @@ -52,16 +14,7 @@ echo while true do fuGETSYS - printf "%-19s %-36s %s\n" "NAME" "STATUS" "PORTS" - for i in $myIMAGES; do - myNAME="$myMAGENTA$i$myWHITE" - printf "%-32s %-49s %s" "$myNAME" "$(fuCONTAINERSTATUS $i)" "$(fuCONTAINERPORTS $i)" - echo - if [ "$myPARAM" = "vv" ]; - then - /usr/bin/docker exec -t "$i" sh -c "stty rows 50 cols 1000 && /bin/ps aux | egrep -v -E 'awfuwfxwf|/bin/ps'" - fi - done + 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" diff --git a/iso/preseed/tpot.seed b/iso/preseed/tpot.seed index 5bc41fb0..4f18ce38 100755 --- a/iso/preseed/tpot.seed +++ b/iso/preseed/tpot.seed @@ -101,7 +101,7 @@ tasksel tasksel/first multiselect ubuntu-server ######################## ### Package Installation ######################## -d-i pkgsel/include string apache2-utils apparmor apt-transport-https aufs-tools bash-completion build-essential ca-certificates cgroupfs-mount curl dialog dnsutils docker.io docker-compose dstat ethtool genisoimage git glances html2text htop ifupdown iptables iw jq libcrack2 libltdl7 lm-sensors man net-tools npm ntp openssh-server openssl prips syslinux psmisc pv python-pip unzip vim wireless-tools wpasupplicant +d-i pkgsel/include string apache2-utils apparmor apt-transport-https aufs-tools bash-completion build-essential ca-certificates cgroupfs-mount curl dialog dnsutils docker.io docker-compose dstat ethtool genisoimage git glances grc html2text htop ifupdown iptables iw jq libcrack2 libltdl7 lm-sensors man net-tools npm ntp openssh-server openssl prips syslinux psmisc pv python-pip unzip vim wireless-tools wpasupplicant ################# ### Update Policy