1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/calibreweb_ynh.git synced 2024-09-03 18:16:20 +02:00

Test integration Yunohost Multimedia

This commit is contained in:
Krakinou 2018-12-19 20:48:31 +01:00
parent db68e5ecf1
commit d0132b59ba
2 changed files with 43 additions and 0 deletions

View file

@ -3,3 +3,40 @@
pkg_dependencies="sqlite3" pkg_dependencies="sqlite3"
create_dir=0 create_dir=0
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# YUNOHOST MULTIMEDIA INTEGRATION
#=================================================
# Install or update the main directory yunohost.multimedia
#
# usage: ynh_multimedia_build_main_dir
ynh_multimedia_build_main_dir () {
local ynh_media_release="v1.0"
# local checksum="4852c8607db820ad51f348da0dcf0c88"
# Download yunohost.multimedia scripts
wget -nv https://github.com/Krakinou/yunohost.multimedia/archive/${ynh_media_release}.tar.gz
# Verify checksum
# echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
# || ynh_die "Corrupt source"
# Extract
mkdir yunohost.multimedia-master
tar -xf ${ynh_media_release}.tar.gz -C yunohost.multimedia-master --strip-components 1
./yunohost.multimedia-master/script/ynh_media_build.sh
}
# 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

@ -111,6 +111,9 @@ ynh_add_nginx_config
# Create a system user # Create a system user
ynh_system_user_create $app ynh_system_user_create $app
#add user to multimedia group
usermod -a -G multimedia $app
chown -R $app: $final_path chown -R $app: $final_path
#================================================= #=================================================
@ -124,6 +127,9 @@ ynh_add_systemd_config
# CREATE FILES AND DIRECTORIES # CREATE FILES AND DIRECTORIES
#================================================= #=================================================
# Build YunoHost multimedia directories
ynh_multimedia_build_main_dir
#Check if library folder exists. If not create it #Check if library folder exists. If not create it
if [ ! -e "$calibre_dir" ]; then if [ ! -e "$calibre_dir" ]; then
ynh_print_info "Create calibre library folder $calibre_dir" ynh_print_info "Create calibre library folder $calibre_dir"