mirror of
https://github.com/YunoHost-Apps/linuxdash_ynh.git
synced 2024-09-03 19:36:07 +02:00
Update scripts.
This commit is contained in:
parent
d88d2c6362
commit
f5d9fdb582
3 changed files with 10 additions and 6 deletions
|
@ -1,17 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
app=linuxdash
|
||||
|
||||
# Retrieve arguments
|
||||
domain=$1
|
||||
path=$2
|
||||
|
||||
# Check domain/path availability
|
||||
sudo yunohost app checkurl $domain$path -a linuxdash
|
||||
sudo yunohost app checkurl $domain$path -a $app
|
||||
if [[ ! $? -eq 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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
|
||||
|
||||
|
@ -21,11 +23,10 @@ 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
|
||||
|
||||
# Reload web server & sso
|
||||
# Reload web server
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
||||
|
|
|
@ -2,5 +2,9 @@
|
|||
|
||||
domain=$(sudo yunohost app setting linuxdash domain)
|
||||
|
||||
# Remove sources and nginx configuration
|
||||
sudo rm -rf /var/www/linuxdash
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/linuxdash.conf
|
||||
|
||||
# Reload nginx configuration
|
||||
sudo service nginx reload
|
||||
|
|
|
@ -25,4 +25,3 @@ sudo chmod 600 $nginxconf
|
|||
|
||||
# Reload web server & sso
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
||||
|
|
Loading…
Reference in a new issue