mirror of
https://github.com/YunoHost/test_apps.git
synced 2024-09-03 20:06:29 +02:00
Remove sudo prefix for change_url_app_ynh to test that change_url scripts are actually run as root. (#1)
This commit is contained in:
parent
4dae0ae0ee
commit
d876bbcfb2
3 changed files with 15 additions and 15 deletions
|
@ -12,11 +12,11 @@ new_path=$YNH_APP_NEW_PATH
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||||
|
|
||||||
if [[ "$new_path" == "" ]]; then
|
if [[ "$new_path" == "" ]]; then
|
||||||
sudo sed -i "s@location .\+ {@location / {@g" $nginx_conf_path
|
sed -i "s@location .\+ {@location / {@g" $nginx_conf_path
|
||||||
else
|
else
|
||||||
sudo sed -i "s@location .\+ {@location $new_path {@g" $nginx_conf_path
|
sed -i "s@location .\+ {@location $new_path {@g" $nginx_conf_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $old_domain != $new_domain ]; then
|
if [ $old_domain != $new_domain ]; then
|
||||||
sudo mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -8,7 +8,7 @@ domain=$YNH_APP_ARG_DOMAIN
|
||||||
path=$YNH_APP_ARG_PATH
|
path=$YNH_APP_ARG_PATH
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
sudo yunohost app checkurl $domain$path -a $app
|
yunohost app checkurl $domain$path -a $app
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -19,16 +19,16 @@ else
|
||||||
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo sed -i "s@FOLDER@$app/@g" ../conf/nginx.conf
|
sed -i "s@FOLDER@$app/@g" ../conf/nginx.conf
|
||||||
|
|
||||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
||||||
sudo mkdir -p /var/www/$app
|
mkdir -p /var/www/$app
|
||||||
|
|
||||||
sudo cp ../conf/index.html /var/www/$app
|
cp ../conf/index.html /var/www/$app
|
||||||
|
|
||||||
# Reload Nginx and regenerate SSOwat conf
|
# Reload Nginx and regenerate SSOwat conf
|
||||||
sudo service nginx reload
|
service nginx reload
|
||||||
|
|
||||||
sudo yunohost app setting $app unprotected_uris -v "/"
|
yunohost app setting $app unprotected_uris -v "/"
|
||||||
sudo yunohost app ssowatconf
|
yunohost app ssowatconf
|
||||||
|
|
|
@ -3,9 +3,9 @@ set -eux
|
||||||
# See comments in install script
|
# See comments in install script
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
domain=$(sudo yunohost app setting $app domain)
|
domain=$(yunohost app setting $app domain)
|
||||||
|
|
||||||
sudo rm -rf /var/www/$app
|
rm -rf /var/www/$app
|
||||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
||||||
sudo service nginx reload
|
service nginx reload
|
||||||
|
|
Loading…
Reference in a new issue