8000 mhn/install.sh at cowrie · newdominic/mhn · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
executable file
·
91 lines (74 loc) · 2.44 KB

install.sh

File metadata and controls

executable file
·
91 lines (74 loc) · 2.44 KB
#!/bin/bash
if [ "$(whoami)" != "root" ]
then
echo -e "You must be root to run this script"
exit 1
fi
set -e
MHN_HOME=`dirname "$(readlink -f "$0")"`
SCRIPTS="$MHN_HOME/scripts/"
cd $SCRIPTS
if [ -f /etc/redhat-release ]; then
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$PATH
./install_sqlite.sh
if [ ! -f /usr/local/bin/python2.7 ]; then
echo "[`date`] Installing Python2.7 as a pre-req"
./install_python2.7.sh
fi
./install_supervisord.sh
fi
echo "[`date`] Starting Installation of all MHN packages"
echo "[`date`] ========= Installing hpfeeds ========="
./install_hpfeeds.sh
echo "[`date`] ========= Installing menmosyne ========="
./install_mnemosyne.sh
echo "[`date`] ========= Installing Honeymap ========="
./install_honeymap.sh
echo "[`date`] ========= Installing MHN Server ========="
./install_mhnserver.sh
echo "[`date`] ========= MHN Server Install Finished ========="
echo ""
while true;
do
echo -n "Would you like to integrate with Splunk? (y/n) "
read SPLUNK
if [ "$SPLUNK" == "y" -o "$SPLUNK" == "Y" ]
then
echo -n "Splunk Forwarder Host: "
read SPLUNK_HOST
echo -n "Splunk Forwarder Port: "
read SPLUNK_PORT
echo "The Splunk Universal Forwarder will send all MHN logs to $SPLUNK_HOST:$SPLUNK_PORT"
./install_splunk_universalforwarder.sh "$SPLUNK_HOST" "$SPLUNK_PORT"
./install_hpfeeds-logger-splunk.sh
break
elif [ "$SPLUNK" == "n" -o "$SPLUNK" == "N" ]
then
echo "Skipping Splunk integration"
echo "The splunk integration can be completed at a later time by running this:"
echo " cd /opt/mhn/scripts/"
echo " sudo ./install_splunk_universalforwarder.sh <SPLUNK_HOST> <SPLUNK_PORT>"
echo " sudo ./install_hpfeeds-logger-splunk.sh"
break
fi
done
while true;
do
echo -n "Would you like to install ELK? (y/n) "
read ELK
if [ "$ELK" == "y" -o "$ELK" == "Y" ]
then
./install_elk.sh
break
elif [ "$ELK" == "n" -o "$ELK" == "N" ]
then
echo "Skipping ELK installation"
echo "The ELK installationg can be completed at a later time by running this:"
echo " cd /opt/mhn/scripts/"
echo " sudo ./install_elk.sh"
break
fi
done
chown www-data /var/log/mhn/mhn.log
supervisorctl restart mhn-celery-worker
echo "[`date`] Completed Installation of all MHN packages"
0