Merge pull request #111 from SteveClement/CentOS_RHEL

fix: [installer] Make it work on RHEL/CentOS
pull/113/head
Steve Clement 2019-07-01 15:16:13 +09:00 committed by GitHub
commit 8dae1b1524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 4 deletions

View File

@ -6,13 +6,34 @@
## Debug mode
#set -x
# Functions
get_distribution() {
lsb_dist=""
# Every system that we officially support has /etc/os-release
if [ -r /etc/os-release ]; then
lsb_dist="$(. /etc/os-release && echo "$ID")"
fi
# Returning an empty string here should be alright since the
# case statements don't act unless you provide an actual value
echo "$lsb_dist" | tr '[:upper:]' '[:lower:]'
}
sudo chmod -R g+w .
if ! id zmqs >/dev/null 2>&1; then
if [ "$(get_distribution)" == "rhel" ]; then
# Create zmq user
sudo useradd -U -G apache -m -s /usr/bin/bash zmqs
# Adds right to www-data to run ./start-zmq as zmq
echo "apache ALL=(zmqs) NOPASSWD:/bin/bash /var/www/misp-dashboard/start_zmq.sh" |sudo tee /etc/sudoers.d/apache
else
# Create zmq user
sudo useradd -U -G www-data -m -s /bin/bash zmqs
# Adds right to www-data to run ./start-zmq as zmq
sudo echo "www-data ALL=(zmqs) NOPASSWD:/bin/bash /var/www/misp-dashboard/start_zmq.sh" > /etc/sudoers.d/www-data
echo "www-data ALL=(zmqs) NOPASSWD:/bin/bash /var/www/misp-dashboard/start_zmq.sh" |sudo tee /etc/sudoers.d/www-data
fi
fi
sudo apt-get install python3-virtualenv virtualenv screen redis-server unzip -y