-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsplunkInstall.sh
59 lines (38 loc) · 1.24 KB
/
splunkInstall.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
52
53
54
55
56
57
58
59
#!/bin/bash
source ./helpers/install.sh
BC=$'\e[4m'
EC=$'\e[0m'
printf "\n"
read -p "Enter a deployment type (${BC}UF${EC} for universal forwarder or ${BC}ENT${EC} for Enterprise version) followed by enter> " deployVar
deployVar=`printf "${deployVar}" | tr '[a-z]' '[A-Z]'`
if [ $deployVar = "UF" ]; then
if (( $(ps -ef | grep -v grep | grep splunkd | wc -l) != 0 )); then
printf "\n"
read -p "A splunk instance is already running, do you want to remove it? (y or n): " conf
conf=`printf "${conf}" | tr '[A-Z]' '[a-z]'`
if [ $conf = 'y' ]; then
splunkRemove $deployVar
splunkInstall $deployVar
else
printf "\nExiting....\n"
fi
else
splunkInstall $deployVar
fi
elif [ $deployVar = "ENT" ]; then
if (( $(ps -ef | grep -v grep | grep splunkd | wc -l) != 0 )); then
printf "\n"
read -p "A splunk instance is already running, do you want to remove it? (y or n): " conf
conf=`printf "${conf}" | tr '[A-Z]' '[a-z]'`
if [ $conf = 'y' ]; then
splunkRemove $deployVar
splunkInstall $deployVar
else
printf "\nExiting....\n"
fi
else
splunkInstall $deployVar
fi
else
printf "\nEnter a valid deployment\n"
fi