summarylogtreecommitdiffstats
path: root/splunkforwarder.install
blob: d0c93c9c168a614ada33ce366ba87d7c280d67df (plain)
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
SPLUNK_HOME="/opt/splunkforwarder"

post_install() {
	if [ ! -f "$SPLUNK_HOME/etc/splunk-launch.conf" ]; then
		sed "s%# SPLUNK_HOME=.*%SPLUNK_HOME=$SPLUNK_HOME%g" "$SPLUNK_HOME/etc/splunk-launch.conf.default" > "$SPLUNK_HOME/etc/splunk-launch.conf"
	fi

	# Build the post-install message in steps:
	touch "$SPLUNK_HOME/ftr"
	echo "-------------------------------------------------------------------------" > "$SPLUNK_HOME/ftr"
	echo "Splunk has been installed in:" >> "$SPLUNK_HOME/ftr"
	echo "	$SPLUNK_HOME" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "To start Splunk, run the command:" >> "$SPLUNK_HOME/ftr"
	echo "	$SPLUNK_HOME/bin/splunk start" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "To use the Splunk web interface, point your browser to:" >> "$SPLUNK_HOME/ftr"
	echo "	http://$HOSTNAME:8000" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "Complete documentation is at http://docs.splunk.com/Documentation/Splunk" >> "$SPLUNK_HOME/ftr"
	echo "-------------------------------------------------------------------------" >> "$SPLUNK_HOME/ftr"

	echo "Splunk forwarder has been installed to $SPLUNK_HOME"
	echo "You can start Splunk by running 'systemctl start splunkforwarder'"
}

pre_upgrade() {
	echo "Attempting to stop the installed Splunk Server..."
	systemctl stop splunkforwarder
}

post_upgrade() {
	# Build the post-upgrade message in steps:
	touch "$SPLUNK_HOME/ftr"
	echo "-------------------------------------------------------------------------" > "$SPLUNK_HOME/ftr"
	echo "Splunk has been updated in:" >> "$SPLUNK_HOME/ftr"
	echo "	$SPLUNK_HOME" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "To start Splunk, run the command:" >> "$SPLUNK_HOME/ftr"
	echo "	$SPLUNK_HOME/bin/splunk start" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "To use the Splunk web interface, point your browser to:" >> "$SPLUNK_HOME/ftr"
	echo "	http://$HOSTNAME:8000" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "" >> "$SPLUNK_HOME/ftr"
	echo "Complete documentation is at http://docs.splunk.com/Documentation/Splunk" >> "$SPLUNK_HOME/ftr"
	echo "-------------------------------------------------------------------------" >> "$SPLUNK_HOME/ftr"

	echo "Splunk forwarder has been upgraded in $SPLUNK_HOME"
	echo "Run 'systemctl start splunkforwarder' to complete the upgrade."
}

pre_remove() {
	echo "Attempting to stop the installed Splunk Server..."
	systemctl stop splunkforwarder
}