1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cesium_ynh.git synced 2024-09-03 18:06:25 +02:00

[mod] Remove now useless 'sudo' prefix, all commands are now run as root

This commit is contained in:
Moul 2020-03-05 20:27:10 +01:00
parent 23c2861cc1
commit 75929a36cd
4 changed files with 18 additions and 18 deletions

View file

@ -16,22 +16,22 @@ source /usr/share/yunohost/helpers
ynh_app_setting_set "$app" is_public "$is_public" ynh_app_setting_set "$app" is_public "$is_public"
# Check domain/path availability # Check domain/path availability
sudo yunohost app checkurl "${domain}${path}" -a "$app" \ yunohost app checkurl "${domain}${path}" -a "$app" \
|| ynh_die "Path not available: ${domain}${path}" || ynh_die "Path not available: ${domain}${path}"
# Retrieve sources and install them # Retrieve sources and install them
src_path=/var/www/$app src_path=/var/www/$app
sudo mkdir -p $src_path mkdir -p $src_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_script_progression --message="Setting up source files..." --time --weight=1 ynh_script_progression --message="Setting up source files..." --time --weight=1
ynh_setup_source --dest_dir=$src_path ynh_setup_source --dest_dir=$src_path
sudo chown -R www-data: $src_path chown -R www-data: $src_path
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory
nginx_conf=../conf/nginx.conf nginx_conf=../conf/nginx.conf
sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
# If app is public, add url to SSOWat conf as skipped_uris # If app is public, add url to SSOWat conf as skipped_uris
if [[ $is_public -eq 1 ]]; then if [[ $is_public -eq 1 ]]; then
@ -40,4 +40,4 @@ if [[ $is_public -eq 1 ]]; then
fi fi
# Reload nginx service # Reload nginx service
sudo service nginx reload service nginx reload

View file

@ -8,10 +8,10 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)
# Remove sources # Remove sources
sudo rm -rf /var/www/$app rm -rf /var/www/$app
# Remove configuration files # Remove configuration files
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf rm -f /etc/nginx/conf.d/$domain.d/$app.conf
# Reload nginx service # Reload nginx service
sudo service nginx reload service nginx reload

View file

@ -17,19 +17,19 @@ domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path) path=$(ynh_app_setting_get "$app" path)
# Check domain/path availability # Check domain/path availability
sudo yunohost app checkurl "${domain}${path}" -a "$app" \ yunohost app checkurl "${domain}${path}" -a "$app" \
|| ynh_die "Path not available: ${domain}${path}" || ynh_die "Path not available: ${domain}${path}"
# Restore sources & data # Restore sources & data
src_path="/var/www/${app}" src_path="/var/www/${app}"
sudo cp -a ./sources "$src_path" cp -a ./sources "$src_path"
# Restore permissions to app files # Restore permissions to app files
# you may need to make some file and/or directory writeable by www-data (nginx user) # you may need to make some file and/or directory writeable by www-data (nginx user)
sudo chown -R www-data: "$src_path" chown -R www-data: "$src_path"
# Restore NGINX configuration # Restore NGINX configuration
sudo cp -a ./nginx.conf "/etc/nginx/conf.d/${domain}.d/${app}.conf" cp -a ./nginx.conf "/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Restart webserver # Restart webserver
sudo service nginx reload service nginx reload

View file

@ -27,13 +27,13 @@ path=${path%/}
src_path=/var/www/$app src_path=/var/www/$app
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
sudo rm -rf $src_path rm -rf $src_path
sudo mkdir -p $src_path mkdir -p $src_path
ynh_script_progression --message="Upgrading source files..." --time --weight=1 ynh_script_progression --message="Upgrading source files..." --time --weight=1
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$src_path ynh_setup_source --dest_dir=$src_path
sudo chown -R www-data: $src_path chown -R www-data: $src_path
fi fi
@ -41,7 +41,7 @@ fi
nginx_conf=../conf/nginx.conf nginx_conf=../conf/nginx.conf
sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
# If app is public, add url to SSOWat conf as skipped_uris # If app is public, add url to SSOWat conf as skipped_uris
if [[ $is_public -eq 1 ]]; then if [[ $is_public -eq 1 ]]; then
@ -49,4 +49,4 @@ if [[ $is_public -eq 1 ]]; then
fi fi
# Reload nginx service # Reload nginx service
sudo service nginx reload service nginx reload