-
Notifications
You must be signed in to change notification settings - Fork 3
/
light-attack-simulation.sh
executable file
·51 lines (48 loc) · 900 Bytes
/
light-attack-simulation.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
Help()
{
# Display Help
echo ""
echo "Syntax: ./light-attack-simulation.sh [-h] [run|delete] [techniqueName] [-n|--namspace]"
echo ""
echo "required arguments:"
echo "run run technique simulation"
echo "delete delete technique simulation"
echo "techniqueName name of the use-case"
echo ""
echo "other arguments:"
echo "-h --help show this help message and exit"
echo "-n --namespcae install pod on spesific namespace"
}
namespace="default"
while test $# -gt 0; do
case "$1" in
run)
shift
operation="run"
yaml="$1.yaml"
shift
;;
delete)
shift
operation="delete"
yaml="$1"
shift
;;
-h|--help)
Help
exit 0
;;
-n|--namespace)
shift
namespace=$1
shift
;;
esac
done
if [ $operation == "run" ]; then
kubectl apply -f ./manifests/$yaml -n $namespace
else
kubectl delete pods $yaml -n $namespace
fi
exit 0