2015-09-28 22:13:34 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# Retrieve arguments
|
|
|
|
domain=$1
|
|
|
|
path=$2
|
|
|
|
|
|
|
|
# Check domain/path availability
|
|
|
|
sudo yunohost app checkurl $domain$path -a noalyss
|
|
|
|
if [[ ! $? -eq 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
path=${path%/}
|
|
|
|
|
|
|
|
sudo yunohost app setting dolibarr version -v "3.8.0"
|
2015-09-28 23:02:46 +02:00
|
|
|
|
|
|
|
final_path=/var/www/noalyss
|
|
|
|
sudo mkdir -p $final_path
|
|
|
|
sudo cp -a ../sources/dolibarr/* $final_path
|
|
|
|
|
|
|
|
sudo chown -R www-data: $final_path
|
|
|
|
|
|
|
|
touch $final_path/dolibarr/conf/conf.php
|
2015-09-28 23:07:52 +02:00
|
|
|
|
|
|
|
if [[ "$path" == "" ]]; then
|
|
|
|
sed -i "s@PATHTOCHANGE@/@g" ../conf/nginx.conf
|
|
|
|
else
|
|
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
|
|
|
fi
|
|
|
|
|
|
|
|
sed -i "s@ALIASTOCHANGE@$final_path/htdocs/@g" ../conf/nginx.conf
|
|
|
|
|
|
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/dolibarr.conf
|
|
|
|
|
|
|
|
sed -i "s@NAMETOCHANGE@noalyss@g" ../conf/php-fpm.conf
|
|
|
|
sudo cp ../conf/noalyss.conf $final_path/include/config.inc.php
|