-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathremove_stack.sh
31 lines (26 loc) · 1.1 KB
/
remove_stack.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# ************************************************************************** #
# #
# remove_stack.sh #
# #
# By: elhmn <www.elhmn.com> #
# <[email protected]> #
# #
# Created: Sun Aug 26 08:21:49 2018 by elhmn #
# Updated: Sun Aug 26 09:11:56 2018 by bmbarga #
# #
# ************************************************************************** #
#!/bin/sh
# Usage :
# ./script.sh stackName
removeStack()
{
stackName=ac_lab
if [ ! -z "$1" ]; then
stackName=$1
fi
if docker stack ls | cut -d' ' -f1 | grep $stackName; then
docker stack rm $stackName
else
echo "$stackName does not exit"
fi
}