Apply suggestions from code review

This commit is contained in:
Alexandre Aubin 2021-08-18 19:47:46 +02:00 committed by GitHub
parent 29db3d51ff
commit 4b84922315
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -32,9 +32,9 @@ ynh_multimedia_build_main_dir() {
ln -sfn "$MEDIA_DIRECTORY/share" "$MEDIA_DIRECTORY/$user/Share"
# Création du lien symbolique dans le home de l'utilisateur.
#link will only be created if the home directory of the user exists and if it's located in '/home' folder
home="$(getent passwd $user | cut -d: -f6)"
if [[ -d "$home" && "$(echo "$home" | grep /home/)" ]]; then
ln -sfn "$MEDIA_DIRECTORY/$user" "$home/Multimedia"
local user_home="$(getent passwd $user | cut -d: -f6 | grep '^/home/')"
if [[ -d "$user_home" ]]; then
ln -sfn "$MEDIA_DIRECTORY/$user" "$user_home/Multimedia"
fi
# Propriétaires des dossiers utilisateurs.
chown -R $user "$MEDIA_DIRECTORY/$user"

View file

@ -16,9 +16,9 @@ mkdir -p "$MEDIA_DIRECTORY/$user/eBook"
ln -sfn "$MEDIA_DIRECTORY/share" "$MEDIA_DIRECTORY/$user/Share"
# Création du lien symbolique dans le home de l'utilisateur.
#link will only be created if the home directory of the user exists and if it's located in '/home' folder
home="$(getent passwd $user | cut -d: -f6)"
if [[ -d "$home" && "$(echo "$home" | grep /home/)" ]]; then
ln -sfn "$MEDIA_DIRECTORY/$user" "$home/Multimedia"
local user_home="$(getent passwd $user | cut -d: -f6 | grep '^/home/')"
if [[ -d "$user_home" ]]; then
ln -sfn "$MEDIA_DIRECTORY/$user" "$user_home/Multimedia"
fi
# Propriétaires des dossiers utilisateurs.
chown -R $user "$MEDIA_DIRECTORY/$user"