Permalink
Browse files

Adding services:remove

  • Loading branch information...
darron committed Jan 9, 2015
1 parent 62f5de8 commit 1f8ad3c474130d38084922862f16816dd6f15dca
Showing with 23 additions and 1 deletion.
  1. +23 −1 bin/octo
View
@@ -186,6 +186,7 @@ case "$1" in
sudo docker kill "$ID" > /dev/null
octo service:rm "$BASE" "$PORT"
done
/usr/bin/octo services:remove "$BASE"
else
echo "Usage: octo stop {container}"
fi
@@ -414,10 +415,15 @@ case "$1" in
/usr/bin/octo service:rm $BASE $PORT
fi
done
# Remove HTTP tagged orphans from crashed containers.
/usr/bin/octo services:remove_all
;;
services:remove_all)
# Remove HTTP tagged orphans from crashed containers.
for service in $(/usr/bin/octo services); do
if echo $service | grep -q 'http'
then
then
ID=$(echo $service | jq .ID | cut -d '"' -f 2)
PORT=$(echo $ID | grep -o [0-9]*$)
BASE=${ID%-$PORT}
@@ -426,6 +432,22 @@ case "$1" in
done
;;
services:remove)
if [ $2 ]; then
for service in $(/usr/bin/octo services | grep "$2"); do
if echo $service | grep -q 'http'
then
ID=$(echo $service | jq .ID | cut -d '"' -f 2)
PORT=$(echo $ID | grep -o [0-9]*$)
BASE=${ID%-$PORT}
/usr/bin/octo service:rm $BASE $PORT
fi
done
else
echo "Usage: octo services:remove {container}"
fi
;;
domains:set)
if [[ $2 && $3 ]]; then
DOMAINS=$(get_unique_domains $3)

0 comments on commit 1f8ad3c

Please sign in to comment.