1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dolibarr_ynh.git synced 2024-09-03 18:35:53 +02:00
dolibarr_ynh/scripts/install

47 lines
1 KiB
Text
Raw Normal View History

2015-09-28 22:13:34 +02:00
set -e
# Retrieve arguments
domain=$1
path=$2
# Check domain/path availability
2015-09-28 23:17:30 +02:00
sudo yunohost app checkurl $domain$path -a dolibarr
2015-09-28 22:13:34 +02:00
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
2015-09-28 23:17:30 +02:00
final_path=/var/www/dolibarr
2015-09-28 23:02:46 +02:00
sudo mkdir -p $final_path
sudo cp -a ../sources/dolibarr/* $final_path
sudo chown -R www-data: $final_path
2015-09-29 00:04:43 +02:00
touch $final_path/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
2015-09-28 23:17:30 +02:00
sed -i "s@NAMETOCHANGE@ndolibarr@g" ../conf/php-fpm.conf
finalphpconf=/etc/php5/fpm/pool.d/noalyss.conf
sudo cp ../conf/php-fpm.conf $finalphpconf
sudo chown root: $finalphpconf
sudo chmod 644 $finalphpconf
2015-09-28 23:10:22 +02:00
# Reload Nginx and regenerate SSOwat conf
sudo service php5-fpm restart
sudo service nginx reload
sudo yunohost app ssowatconf