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:
parent
34ae5082fa
commit
67499e79be
3 changed files with 14 additions and 6 deletions
|
@ -40,6 +40,7 @@ sudo cp ../conf/nginx.conf $nginxconf
|
||||||
sudo chown root: $nginxconf
|
sudo chown root: $nginxconf
|
||||||
sudo chmod 600 $nginxconf
|
sudo chmod 600 $nginxconf
|
||||||
|
|
||||||
|
# Only give one user access to this app
|
||||||
sudo yunohost app removeaccess $app
|
sudo yunohost app removeaccess $app
|
||||||
sudo yunohost app addaccess $app -u $user
|
sudo yunohost app addaccess $app -u $user
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
app=linuxdash
|
app=linuxdash
|
||||||
domain=$(sudo yunohost app setting linuxdash domain)
|
domain=$(sudo yunohost app setting $app domain)
|
||||||
|
|
||||||
# Remove sources and nginx configuration
|
# Remove sources and nginx configuration
|
||||||
sudo rm -rf /var/www/$app
|
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 supervisorctl stop $app
|
||||||
sudo rm -f /etc/supervisor/conf.d/$app.conf
|
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
|
# Reload nginx configuration
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Retrieve settings
|
# Retrieve settings
|
||||||
domain=$(sudo yunohost app setting linuxdash domain)
|
app=linuxdash
|
||||||
path=$(sudo yunohost app setting linuxdash path)
|
domain=$(sudo yunohost app setting $app domain)
|
||||||
|
path=$(sudo yunohost app setting $app path)
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
# Remove trailing "/" for next commands
|
||||||
path=${path%/}
|
path=${path%/}
|
||||||
|
|
||||||
# Copy files to the right place
|
# Copy files to the right place
|
||||||
final_path=/var/www/linuxdash
|
final_path=/var/www/$app
|
||||||
sudo mkdir -p $final_path
|
sudo mkdir -p $final_path
|
||||||
sudo cp -a ../sources/* $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
|
# 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_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/$app.conf
|
||||||
nginxconf=/etc/nginx/conf.d/$domain.d/linuxdash.conf
|
|
||||||
sudo cp ../conf/nginx.conf $nginxconf
|
sudo cp ../conf/nginx.conf $nginxconf
|
||||||
sudo chown root: $nginxconf
|
sudo chown root: $nginxconf
|
||||||
sudo chmod 600 $nginxconf
|
sudo chmod 600 $nginxconf
|
||||||
|
|
||||||
|
# Restart Linux-dash service
|
||||||
|
sudo supervisorctl restart $app
|
||||||
|
|
||||||
# Reload web server & sso
|
# Reload web server & sso
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
|
|
Loading…
Reference in a new issue