Jeremy MANSON 93a05133b0 first commit
Adding scripts Primitives "install" " delete" "upgrade" and nginx conf
2016-03-07 10:19:14 +01:00

46 lines
1.0 KiB
Bash

#!/bin/bash
# Retrieve arguments
domain=$1
path=$2
sudo yunohost app checkurl $domain$path -a shinken
if [[ ! $? -eq 0 ]]; then
exit 1
fi
# Create user
id -u shinken &>/dev/null || sudo useradd -d /home/yunohost.app/shinken shinken
# Install required packages
sudo apt-get install -y apt-get install python-cherrypy3 python-pip python-pycurl nagios-plugins
sudo bash -c "pip install shinken"
# prepare shinken
sudo pip install pymongo>=3.0.3 requests arrow bottle==0.12.8 passlib
sudo apt-get install mongodb
sudo su -c shinken --int -l shinken
sudo su -c shinken install webui2 -l shinken
# Remove trailing "/" for next commands
path=${path%/}
# Monitor service
sudo yunohost service add shinken
# Configure Nginx
sudo sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/shinken.conf
# Add new shinken service
sudo update-rc.d shinken defaults
# Generate SSOwat conf
sudo service nginx restart
echo $?
sudo yunohost app ssowatconf
sudo service shinken start