new option docker-status --stop to stop (end therefore restart) a container

master
Marc Wäckerlin 7 years ago
commit 39441c5343
  1. 38
      docker-status

@ -1,26 +1,22 @@
#!/bin/bash -e
############################################################################ begin logging
# check if stdout is a terminal...
if test -t 1; then
# see if it supports colors...
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
bold="$(tput bold)"
underline="$(tput smul)"
standout="$(tput smso)"
normal="$(tput sgr0)"
black="$(tput setaf 0)"
red="$(tput setaf 1)"
green="$(tput setaf 2)"
yellow="$(tput setaf 3)"
blue="$(tput setaf 4)"
magenta="$(tput setaf 5)"
cyan="$(tput setaf 6)"
white="$(tput setaf 7)"
fi
# see if it supports colors...
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
bold="$(tput bold)"
underline="$(tput smul)"
standout="$(tput smso)"
normal="$(tput sgr0)"
black="$(tput setaf 0)"
red="$(tput setaf 1)"
green="$(tput setaf 2)"
yellow="$(tput setaf 3)"
blue="$(tput setaf 4)"
magenta="$(tput setaf 5)"
cyan="$(tput setaf 6)"
white="$(tput setaf 7)"
fi
append_msg() {
@ -174,7 +170,7 @@ services=$(for stack in ${stacks}; do
"
for service in ${status}; do
time=${service%%;*}
echo "$(date -d "$(sed 's,about an* ,1 ,;s,less than an* ,0 ,' <<<${time})");${service#*;}"
echo "$(date +%s -d "$(sed 's,about an* ,1 ,;s,less than an* ,0 ,' <<<${time})");${service#*;}"
done
done | sort -hr)

Loading…
Cancel
Save