Last active
December 21, 2016 16:02
-
-
Save jniltinho/6150ea1a5baf69813373b1d3b6a0cd60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Install SPFBL and JRE8 on Ubuntu 16.04 64Bits | |
### Project -> https://github.com/leonamp/SPFBL | |
## First install wget, unzip | |
## Primeiro instale o wget e unzip | |
# Check if user has root privileges | |
if [[ $EUID -ne 0 ]]; then | |
echo "You must run the script as root or using sudo" | |
exit 1 | |
fi | |
GET_ARCH=$(getconf LONG_BIT) | |
JAVA_PKG="jre-8u111-linux-x64.tar.gz" | |
groupadd spfbl && useradd -M -s /bin/nologin -g spfbl -d /opt/spfbl spfbl | |
### Create Folders | |
mkdir -p /var/log/spfbl && chown -R spfbl:spfbl /var/log/spfbl | |
mkdir -p /opt/spfbl && chown -R spfbl:spfbl /opt/spfbl | |
cd /opt/spfbl | |
echo "Download JRE Package: ${JAVA_PKG} ..." | |
wget --header 'Cookie: oraclelicense=a' http://download.oracle.com/otn-pub/java/jdk/8u111-b14/${JAVA_PKG} | |
tar -xvf ${JAVA_PKG} | |
mv jre1.8.0_111 java | |
rm -f ${JAVA_PKG} | |
wget -c https://github.com/leonamp/SPFBL/archive/master.zip | |
unzip master.zip && rm -f master.zip | |
cp -aR SPFBL-master/dist/SPFBL.jar . | |
cp -aR SPFBL-master/data . | |
cp -aR SPFBL-master/lib . | |
cp -aR SPFBL-master/client . | |
cp -aR SPFBL-master/run/spfbl.conf . | |
cp SPFBL-master/run/spfbl-rotate /etc/logrotate.d/ | |
rm -rf SPFBL-master | |
chown -R spfbl:spfbl * | |
sed -i 's|http_port=80|http_port=9880|' /opt/spfbl/spfbl.conf | |
echo '# Systemd unit file for tomcat | |
[Unit] | |
Description=Project SPFBL | |
After=syslog.target network.target | |
[Service] | |
Type=simple | |
Environment=JAVA_HOME=/opt/spfbl/java | |
Environment=JAVA=/opt/spfbl/java/bin | |
WorkingDirectory=/opt/spfbl | |
ExecStart=/opt/spfbl/java/bin/java -jar /opt/spfbl/SPFBL.jar | |
User=spfbl | |
Group=spfbl | |
[Install] | |
WantedBy=multi-user.target' > /etc/systemd/system/spfbl.service | |
systemctl daemon-reload | |
systemctl start spfbl | |
systemctl enable spfbl | |
## Open in web browser: | |
## http://server_IP_address |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment