2015-04-06 17:46:57 +02:00
|
|
|
#!/bin/bash
|
|
|
|
app=minchat
|
|
|
|
|
|
|
|
# Retrieve arguments
|
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
|
|
|
path=$(sudo yunohost app setting $app path)
|
|
|
|
|
|
|
|
# Remove trailing "/" for next commands
|
|
|
|
path=${path%/}
|
|
|
|
|
|
|
|
# Copy source files
|
|
|
|
final_path=/var/www/$app
|
|
|
|
sudo mkdir -p $final_path
|
|
|
|
sudo cp -a ../sources/* $final_path
|
2015-05-20 23:07:46 +02:00
|
|
|
if [[ ! -f ${final_path}/conf/setup.ini ]] ; then
|
2015-05-20 23:22:42 +02:00
|
|
|
sudo cp ${final_path}/conf/sample/setup.ini ${final_path}/conf/
|
2015-05-20 23:07:46 +02:00
|
|
|
fi
|
2015-04-06 17:46:57 +02:00
|
|
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
|
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
|
|
|
sed -i "s@WWWPATH@$final_path@g" ../conf/nginx.conf
|
|
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
|
|
|
|
# Restart services
|
|
|
|
sudo service nginx reload
|
|
|
|
sudo yunohost app ssowatconf
|
|
|
|
|