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

add ynh_multimedia_addaccess

This commit is contained in:
Kay0u 2020-08-10 11:36:27 +02:00
parent 76509a77c5
commit e141375795
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
4 changed files with 17 additions and 0 deletions

View file

@ -60,3 +60,14 @@ ynh_multimedia_addfolder () {
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir" ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir"
} }
# Grant write access to multimedia directories to a specified user
#
# usage: ynh_multimedia_addaccess user_name
#
# | arg: user_name - User to be granted write access
ynh_multimedia_addaccess () {
local user_name=$1
groupadd -f multimedia
usermod -a -G multimedia $user_name
}

View file

@ -117,6 +117,8 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=3
ynh_multimedia_build_main_dir ynh_multimedia_build_main_dir
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts"
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists"
# Allow airsonic to write into these directories
ynh_multimedia_addaccess $app
#================================================= #=================================================
# ENABLE "TRANSCODE" # ENABLE "TRANSCODE"

View file

@ -153,6 +153,8 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=3
ynh_multimedia_build_main_dir ynh_multimedia_build_main_dir
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts"
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists"
# Allow airsonic to write into these directories
ynh_multimedia_addaccess $app
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -138,6 +138,8 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=3
ynh_multimedia_build_main_dir ynh_multimedia_build_main_dir
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts"
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists"
# Allow airsonic to write into these directories
ynh_multimedia_addaccess $app
if ! grep -q "PodcastFolder" $final_path/airsonic.properties; then if ! grep -q "PodcastFolder" $final_path/airsonic.properties; then
echo "PodcastFolder=/home/yunohost.multimedia/share/Podcasts" >> $final_path/airsonic.properties echo "PodcastFolder=/home/yunohost.multimedia/share/Podcasts" >> $final_path/airsonic.properties