1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/UMS_ynh.git synced 2024-10-01 13:35:01 +02:00

Fix linter warning : home folder

This commit is contained in:
Krakinou 2022-02-16 21:27:51 +01:00
parent 9ceaca2379
commit f72137d366
5 changed files with 28 additions and 21 deletions

View file

@ -76,7 +76,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/home/$app/"
ynh_backup --src_path="/home/yunohost.app/$app/"
#=================================================
# END OF SCRIPT

View file

@ -86,7 +86,7 @@ ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user
#UMS require a home path for the user as config files are stored in there
ynh_system_user_create --username=$app --home_dir=/home/$app
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app
#=================================================
#SETTING MULTIMEDIA DIRECTORY
@ -141,13 +141,13 @@ ynh_add_systemd_config
ynh_script_progression --message="Setting up configuration file.." --weight=5
#UMS read config file from .config/UMS folder
mkdir -p "/home/$app/.config/UMS"
ynh_add_config --template="UMS.conf.default" --destination="/home/$app/.config/UMS/UMS.conf"
ynh_add_config --template="WEB.conf.default" --destination="/home/$app/.config/UMS/WEB.conf"
ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/$app/.config/UMS/VirtualFolders.conf"
chown -R $app:$app "/home/$app/.config"
chmod -R 700 "/home/$app/.config"
#chmod 600 "/home/$app/.config/UMS/*"
mkdir -p "/home/yunohost.app/$app/.config/UMS"
ynh_add_config --template="UMS.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/UMS.conf"
ynh_add_config --template="WEB.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/WEB.conf"
ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/VirtualFolders.conf"
chown -R $app:$app "/home/yunohost.app/$app/.config"
chmod -R 700 "/home/yunohost.app/$app/.config"
#chmod 600 "/home/yunohost.app/$app/.config/UMS/*"
#=================================================
# GENERIC FINALIZATION

View file

@ -108,7 +108,7 @@ ynh_script_progression --message="Removing the dedicated system user..." --weigh
# Delete a system user
ynh_system_user_delete --username=$app
ynh_secure_remove --file="/home/$app"
ynh_secure_remove --file="/home/yunohost.app/$app"
#=================================================
# END OF SCRIPT

View file

@ -68,7 +68,7 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei
# Create the dedicated user (if not existing)
#UMS require a home path for the user as config files are stored in there
ynh_system_user_create --username=$app --home_dir=/home/$app
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app
#=================================================
#SETTING MULTIMEDIA DIRECTORY
@ -125,9 +125,9 @@ yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server."
# RESTORE VARIOUS FILES
#=================================================
mkdir -p /var/log/$app
ynh_restore_file --origin_path="/home/$app/"
chown -R $app:$app "/home/$app/.config"
chmod -R 700 "/home/$app/.config"
ynh_restore_file --origin_path="/home/yunohost.app/$app/"
chown -R $app:$app "/home/yunohost.app/$app/.config"
chmod -R 700 "/home/yunohost.app/$app/.config"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION

View file

@ -29,12 +29,6 @@ upstream_version=$(ynh_app_upstream_version)
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -49,6 +43,19 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
#move home folder from previous /home/app to /home/yunohost.app/$app
#has to be after backup, otherwise backup will not find home folder and will fail
if [ ! $(getent passwd $app | cut -d: -f6 | grep yunohost.app) ]
then
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
usermod -m -d /home/yunohost.app/$app $app
fi
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@ -94,7 +101,7 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=/home/$app
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app
#=================================================
# SPECIFIC UPGRADE