Script cleaned
This commit is contained in:
44
rainloop.sh
44
rainloop.sh
@@ -1,12 +1,18 @@
|
||||
##
|
||||
# Crates system wide avalible rainloop instance
|
||||
# to enable this on a domain create a symlink to the webroot
|
||||
#
|
||||
# and don't forget disable acces to data folder in nginx
|
||||
##
|
||||
###======================###
|
||||
## Rainloop installer ##
|
||||
###======================###
|
||||
#!/bin/bash
|
||||
|
||||
##---------------------------------------------------------------##
|
||||
# Creates a system wide available rainloop instance #
|
||||
# to enable this on a domain create a symlink to the webroot #
|
||||
# Don't forget disable access to the data folder in nginx #
|
||||
##---------------------------------------------------------------##
|
||||
apt install php${phpver}-curl php${phpver}-dom unzip gnupg2 curl -y
|
||||
|
||||
##install
|
||||
##-----------##
|
||||
# Install #
|
||||
##-----------##
|
||||
mkdir -p /opt/rainloop
|
||||
wget http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip -O /tmp/rlcl.zip
|
||||
unzip -q /tmp/rlcl.zip -d /opt/rainloop
|
||||
@@ -15,22 +21,30 @@ rm /tmp/rlcl.zip
|
||||
php /opt/rainloop/index.php > /dev/null 2>&1
|
||||
rm -f /opt/rainloop/data/_data_/_default_/domains/*
|
||||
|
||||
#fetching config files
|
||||
##-------------------------##
|
||||
# fetching config files #
|
||||
##-------------------------##
|
||||
mkdir -p /opt/rainloop/data/_data_/_default_/domains/
|
||||
mkdir -p /opt/rainloop/data/_data_/_default_/configs/
|
||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/rainloop/domains-default.ini -O /opt/rainloop/data/_data_/_default_/domains/default.ini
|
||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/rainloop/application.ini -O /opt/rainloop/data/_data_/_default_/configs/application.ini
|
||||
|
||||
#setting Permissions
|
||||
##-----------------------##
|
||||
# Setting permissions #
|
||||
##-----------------------##
|
||||
chown -R www-data:www-data /opt/rainloop
|
||||
find /opt/rainloop/ -type d -exec chmod 755 {} \;
|
||||
find /opt/rainloop/ -type f -exec chmod 644 {} \;
|
||||
|
||||
#Storing version signature for auto updates
|
||||
##----------------------------------------------##
|
||||
# Storing version signature for auto-updates #
|
||||
##----------------------------------------------##
|
||||
signature=$(curl -s "https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip.asc")
|
||||
echo "$signature" > /var/log/rainloop-installed.asc
|
||||
|
||||
#creating Contact DB
|
||||
##-----------------------##
|
||||
# creating Contact DB #
|
||||
##-----------------------##
|
||||
db_name="rainloop_contacts"
|
||||
db_user="rainloop_contacts"
|
||||
db_pass=$(date +%s|sha256sum|base64|head -c 32)
|
||||
@@ -42,10 +56,14 @@ sed -i 's/MYSQLPASS/'$db_pass'/g' /opt/rainloop/data/_data_/_default_/configs/ap
|
||||
sed -i 's/MYSQLUSER/'$db_user'/g' /opt/rainloop/data/_data_/_default_/configs/application.ini
|
||||
sed -i 's/MYSQLNAME/'$db_name'/g' /opt/rainloop/data/_data_/_default_/configs/application.ini
|
||||
|
||||
#scripts for enableing/disabling admin panel
|
||||
##----------------------------------##
|
||||
# Enabling/disabling admin panel #
|
||||
##----------------------------------##
|
||||
echo "sed -i 's/allow_admin_panel = Off/allow_admin_panel = On/g' /opt/rainloop/data/_data_/_default_/configs/application.ini" > ~/Enable-RLadmin.sh
|
||||
echo "sed -i 's/allow_admin_panel = On/allow_admin_panel = Off/g' /opt/rainloop/data/_data_/_default_/configs/application.ini" > ~/Disable-RLadmin.sh
|
||||
|
||||
#downloading Update tool
|
||||
##---------------------------##
|
||||
# Downloading Update tool #
|
||||
##---------------------------##
|
||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/rainloop/update-tools.sh -O /opt/update-rainloop.sh
|
||||
chmod +x /opt/update-rainloop.sh
|
||||
Reference in New Issue
Block a user