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:
parent
23c2861cc1
commit
75929a36cd
4 changed files with 18 additions and 18 deletions
|
@ -16,22 +16,22 @@ source /usr/share/yunohost/helpers
|
|||
ynh_app_setting_set "$app" is_public "$is_public"
|
||||
|
||||
# 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}"
|
||||
|
||||
# Retrieve sources and install them
|
||||
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
|
||||
ynh_script_progression --message="Setting up source files..." --time --weight=1
|
||||
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
|
||||
nginx_conf=../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_PATH@$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 [[ $is_public -eq 1 ]]; then
|
||||
|
@ -40,4 +40,4 @@ if [[ $is_public -eq 1 ]]; then
|
|||
fi
|
||||
|
||||
# Reload nginx service
|
||||
sudo service nginx reload
|
||||
service nginx reload
|
||||
|
|
|
@ -8,10 +8,10 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$(ynh_app_setting_get "$app" domain)
|
||||
|
||||
# Remove sources
|
||||
sudo rm -rf /var/www/$app
|
||||
rm -rf /var/www/$app
|
||||
|
||||
# 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
|
||||
sudo service nginx reload
|
||||
service nginx reload
|
||||
|
|
|
@ -17,19 +17,19 @@ domain=$(ynh_app_setting_get "$app" domain)
|
|||
path=$(ynh_app_setting_get "$app" path)
|
||||
|
||||
# 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}"
|
||||
|
||||
# Restore sources & data
|
||||
src_path="/var/www/${app}"
|
||||
sudo cp -a ./sources "$src_path"
|
||||
cp -a ./sources "$src_path"
|
||||
|
||||
# Restore permissions to app files
|
||||
# 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
|
||||
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
|
||||
sudo service nginx reload
|
||||
service nginx reload
|
||||
|
|
|
@ -27,13 +27,13 @@ path=${path%/}
|
|||
src_path=/var/www/$app
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
sudo rm -rf $src_path
|
||||
sudo mkdir -p $src_path
|
||||
rm -rf $src_path
|
||||
mkdir -p $src_path
|
||||
ynh_script_progression --message="Upgrading source files..." --time --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir=$src_path
|
||||
sudo chown -R www-data: $src_path
|
||||
chown -R www-data: $src_path
|
||||
fi
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ fi
|
|||
nginx_conf=../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_PATH@$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 [[ $is_public -eq 1 ]]; then
|
||||
|
@ -49,4 +49,4 @@ if [[ $is_public -eq 1 ]]; then
|
|||
fi
|
||||
|
||||
# Reload nginx service
|
||||
sudo service nginx reload
|
||||
service nginx reload
|
||||
|
|
Loading…
Reference in a new issue