An installation script for FreshRSS
#!/bin/bash | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2015 Killian Kemps | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in | |
# all copies or substantial portions of the Software. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
# THE SOFTWARE. | |
############################### | |
# | |
# This script was meant to be used with Ubuntu 14.04 Trusty | |
# This script will install what is required for FreshRSS then download it and install it | |
# | |
# The components installation process was being inspired by Digital Ocean tutorial accessible at : https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04 | |
# | |
################################ | |
# Get the servers IP adress | |
ipadress=$(ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//' | head -n 1) | |
packageName='freshrss' | |
freshrssLocation='https://github.com/FreshRSS/FreshRSS/archive/master.zip' | |
echo "*******************************************************************************" | |
echo "*** FastInstallFreshRSS Script ***" | |
echo "*******************************************************************************" | |
echo "This script will try to install Apache, MySQL, PHP5 and its modules." | |
echo "It will then download and install FreshRSS so you will be able to access it at (you will be able to change the path during the installation) : | |
" | |
echo ' http://'$ipadress'/'$packageName ' | |
' | |
read -p 'Do you want to launch the installation script ? [Y/n] : ' ifInstall | |
if [ $ifInstall = "Y" ] || [ $ifInstall = 'y' ] | |
then | |
sudo apt-get update | |
# Install apache2 | |
sudo apt-get install -y apache2 | |
# Install MySQL | |
sudo apt-get install -y mysql-server php5-mysql | |
sudo mysql_install_db | |
echo "*******************************************************************************" | |
echo "*** FastInstallFreshRSS Script ***" | |
echo "*******************************************************************************" | |
read -p 'Do you want to launch the script to secure your MySQL installation ? [Y/n] : ' ifSecure | |
if [ $ifSecure = "Y" ] || [ $ifSecure = "y" ] | |
then | |
sudo mysql_secure_installation | |
else | |
echo "" | |
echo "Okay, we will not secure your MySQL installation." | |
echo "" | |
fi | |
# Install PHP5 and its modules | |
sudo apt-get install -y php5 libapache2-mod-php5 php5-mcrypt php5-curl | |
sudo service apache2 restart | |
# Download the FreshRSS package | |
wget $freshrssLocation | |
# Unzip the package | |
sudo apt-get install unzip | |
sudo unzip master.zip -d /var/www/html/ | |
sudo rm master.zip | |
echo "*******************************************************************************" | |
echo "*** FastInstallFreshRSS Script ***" | |
echo "*******************************************************************************" | |
read -p 'Which path do you want to access FreshRSS ? ( by default /freshrss ) : ' packageName | |
# Put default value | |
packageName=${packageName:-freshrss} | |
# Rename the folder according to the previous name | |
sudo mv /var/www/html/FreshRSS-master /var/www/html/$packageName | |
# Give the rights to Apache to the data folder | |
sudo chown -R www-data /var/www/html/freshrss/data | |
# Display end message | |
message='Your FreshRSS installation is ready to be used at : http://' | |
echo "*******************************************************************************" | |
echo "*** FastInstallFreshRSS Script ***" | |
echo "*******************************************************************************" | |
echo "" | |
echo $message$ipadress'/'$packageName | |
echo "" | |
else | |
echo "Okay, good bye !" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment