#!/bin/sh OS=$(uname) SPLUNK_HOME=/opt/splunkforwarder TMPDS_APP=$SPLUNK_HOME/etc/apps/Base_DeploymentClient/default # Make sure we have a sane umask umask 022 # Make sure splunkforwarder was installed if [[ ! -e $SPLUNK_HOME/bin/splunk ]]; then echo "Splunk Universal Forwarder is not installed...aborting." exit 1 fi # Make sure management port is available RES=$(netstat -an | grep LISTEN | grep -q 8089; echo $?) if [[ $RES == 0 ]]; then echo "Another process is listening on port 8089...aborting." exit 1 fi echo "Setting deployment server URI..." mkdir -p $TMPDS_APP cat > $TMPDS_APP/deploymentclient.conf <