Skip to content
Snippets Groups Projects
Commit d2daf50b authored by Elian Loraux's avatar Elian Loraux
Browse files

Change path of main.env to allow scripts to be independent

parent 58f3cbd6
No related branches found
No related tags found
1 merge request!17Reorganisation
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
apt-get update
apt-get -y install apt-cacher-ng
......
......@@ -17,12 +17,12 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
apt-get update && apt-get install certbot python-certbot-apache
......
......@@ -18,12 +18,12 @@
set -o nounset # Treat unset variables as an error
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
###########################################################################
# 1. Install docker
......
......@@ -18,12 +18,12 @@
set -o nounset # Treat unset variables as an error
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
if [ -f installDolibarr.env ]
......
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
# Install monit if not installed
apt-get update && apt-get install -y monit
......
......@@ -18,12 +18,12 @@
set -o nounset # Treat unset variables as an error
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
if [ -f installMySQL.env ]
then
......
......@@ -18,12 +18,12 @@
set -o nounset # Treat unset variables as an error
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
###########################################################################
# 1. Download Nexcloud Package
......
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
. $DIR/install/main.env
. $DIR/install/Nextcloud.env
......
......@@ -22,12 +22,12 @@ TB_CONFIG_ServerAdmin=${TB_CONFIG_ServerAdmin:-${SERVER_ADMIN}}
set -o nounset # Treat unset variables as an error
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
DEBIAN_FRONTEND='noninteractive' apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get -qq install git gnulib perl sendmail \
......
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
apt-get update
......
......@@ -20,12 +20,12 @@ set -o nounset # Treat unset variables as an error
apt-get update
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
if [ "${WEB_SERVER}" == "apache2" ]
then
......
......@@ -5,6 +5,9 @@
export MODS="Base GlpiAgent Traefik"
# TODO Racine of NoCloud Auto Instaler
export DIR=/opt/NoCloud-Auto-Installer
# Valid levels are security and upgrade
export MAINTENANCE_LEVEL="security"
......@@ -28,6 +31,3 @@ export CPU_OVERLOAD_TIME=30 # 1h by default
export MEM_OVERLOAD_TIME=30 # 1h by default
# MEM_OVERLOAD_PERCENT is percent of memory usage. The number needs to be between 0 and 100
export MEM_OVERLOAD_PERCENT=75 # 75% by default
# Dir variable
DIR=`dirname $0`
......@@ -17,12 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
INSTALL_DIR=`$DIRinstall`
......
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
SCRIPT_DIRECTORY=$(dirname $0)
if [ -z "$(grep 'capabilities' /etc/apache2/sites-available/collabora.conf)" ]; then
......
......@@ -16,12 +16,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
DOLIBARR_DB=${DOLIBARR_DB:-"dolibarr"}
if [ -z "`dpkg -l | grep dolibarr`" ]
......
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
# Install monit if not installed and general config
if [ -z "$(dpkg -l | grep ' monit ')" ]; then
......
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
# Switch to php-fpm
ver=$(php --version | awk '{print $2}' | head -n 1 | cut -d . -f 1,2)
......
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
version=7.0
dol_path="/usr/share/dolibarr"
......
#!/bin/bash
if [ ! -e `pwd`/../main.env ]
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then
echo "Please copy `pwd`/../main.env.sample to `pwd`/../main.env and edit it"
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it"
exit 1
fi
. `pwd`/../main.env
. $(pwd)/$(dirname "$0")/../main.env
SCRIPT_DIRECTORY=`dirname $0`
. $SCRIPT_DIRECTORY/main.env
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment