1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/linuxdash_ynh.git synced 2024-09-03 19:36:07 +02:00

Scripts updates.

This commit is contained in:
Moul 2016-02-03 16:48:44 +01:00
parent 34ae5082fa
commit 67499e79be
3 changed files with 14 additions and 6 deletions

View file

@ -40,6 +40,7 @@ sudo cp ../conf/nginx.conf $nginxconf
sudo chown root: $nginxconf
sudo chmod 600 $nginxconf
# Only give one user access to this app
sudo yunohost app removeaccess $app
sudo yunohost app addaccess $app -u $user

View file

@ -1,7 +1,7 @@
#!/bin/bash
app=linuxdash
domain=$(sudo yunohost app setting linuxdash domain)
domain=$(sudo yunohost app setting $app domain)
# Remove sources and nginx configuration
sudo rm -rf /var/www/$app
@ -11,5 +11,9 @@ sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
sudo supervisorctl stop $app
sudo rm -f /etc/supervisor/conf.d/$app.conf
# Remove supervisor package
# Need to be manage with future manifest/moulinette Debian package management
# sudo apt-get -y -qq remove supervisor
# Reload nginx configuration
sudo service nginx reload

View file

@ -1,14 +1,15 @@
#!/bin/bash
# Retrieve settings
domain=$(sudo yunohost app setting linuxdash domain)
path=$(sudo yunohost app setting linuxdash path)
app=linuxdash
domain=$(sudo yunohost app setting $app domain)
path=$(sudo yunohost app setting $app path)
# Remove trailing "/" for next commands
path=${path%/}
# Copy files to the right place
final_path=/var/www/linuxdash
final_path=/var/www/$app
sudo mkdir -p $final_path
sudo cp -a ../sources/* $final_path
@ -17,11 +18,13 @@ sudo chown -R www-data: $final_path
# Modify Nginx configuration file and copy it to Nginx conf directory
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
nginxconf=/etc/nginx/conf.d/$domain.d/linuxdash.conf
nginxconf=/etc/nginx/conf.d/$domain.d/$app.conf
sudo cp ../conf/nginx.conf $nginxconf
sudo chown root: $nginxconf
sudo chmod 600 $nginxconf
# Restart Linux-dash service
sudo supervisorctl restart $app
# Reload web server & sso
sudo service nginx reload