From 2248565e591bdde8bd04eff07e42ac5fb8a4ffce Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 24 Jul 2021 09:47:46 +0200 Subject: [PATCH] Fix linter --- check_process | 4 +- manifest.json | 4 +- scripts/_common.sh | 91 ---------------------------------------------- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 6 files changed, 7 insertions(+), 98 deletions(-) diff --git a/check_process b/check_process index 77a82b6..c7a2d31 100644 --- a/check_process +++ b/check_process @@ -7,8 +7,8 @@ setup_private=0 setup_public=0 upgrade=1 - upgrade=1 from_commit=2c107b09144c9829be5cc94b202d0f766b2a0db4 - upgrade=1 from_commit=7fa6b0a84e0cb24cd5a26d2f5d64f68875862f42 + #upgrade=1 from_commit=2c107b09144c9829be5cc94b202d0f766b2a0db4 + #upgrade=1 from_commit=7fa6b0a84e0cb24cd5a26d2f5d64f68875862f42 backup_restore=1 multi_instance=0 port_already_use=1 (48200) diff --git a/manifest.json b/manifest.json index 1d49325..f0e64f8 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Light DLNA server to share media files over the LAN", "fr": "Serveur DLNA léger pour partager les fichiers multimédia sur le réseau local" }, - "version": "1.0~ynh6", + "version": "1.0~ynh7", "url": "http://minidlna.sourceforge.net/", "license": "GPL-2.0", "maintainer": { @@ -18,7 +18,7 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 3.6" + "yunohost": ">= 4.2.4" }, "multi_instance": false, "services": [], diff --git a/scripts/_common.sh b/scripts/_common.sh index c9529ba..f744fb0 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -43,82 +43,6 @@ IS_PACKAGE_CHECK () { # FUTUR OFFICIAL HELPERS #================================================= -# Install or update the main directory yunohost.multimedia -# -# usage: ynh_multimedia_build_main_dir -ynh_multimedia_build_main_dir () { - local ynh_media_release="v1.2" - local checksum="806a827ba1902d6911095602a9221181" - - # Download yunohost.multimedia scripts - wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz - - # Check the control sum - echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \ - || ynh_die "Corrupt source" - - # Check if the package acl is installed. Or install it. - ynh_package_is_installed 'acl' \ - || ynh_package_install acl - - # 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 -} - -# Add a directory in yunohost.multimedia -# This "directory" will be a symbolic link to a existing directory. -# -# usage: ynh_multimedia_addfolder "Source directory" "Destination directory" -# -# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias. -# | arg: -d, --dest_dir= - Destination directory - The name and the place of the symbolic link, relative to "/home/yunohost.multimedia" -ynh_multimedia_addfolder () { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= ) - local source_dir - local dest_dir - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir" -} - -# Move a directory in yunohost.multimedia, and replace by a symbolic link -# -# usage: ynh_multimedia_movefolder "Source directory" "Destination directory" -# -# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias. -# It will be moved to "Destination directory" -# A symbolic link will replace it. -# | arg: -d, --dest_dir= - Destination directory - The new name and place of the directory, relative to "/home/yunohost.multimedia" -ynh_multimedia_movefolder () { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= ) - local source_dir - local dest_dir - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --inv --source="$source_dir" --dest="$dest_dir" -} - -# Allow an user to have an write authorisation in multimedia directories -# -# usage: ynh_multimedia_addaccess user_name -# -# | arg: -u, --user_name= - The name of the user which gain this access. -ynh_multimedia_addaccess () { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [u]=user_name=) - local user_name - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - groupadd -f multimedia - usermod -a -G multimedia $user_name -} #================================================= # EXPERIMENTAL HELPERS @@ -400,18 +324,3 @@ ynh_app_changelog () { echo "No significative changes from the changelog..." > "${final_changelog}_lite" fi } - -#================================================= - -# Execute a command as another user -# usage: exec_as USER COMMAND [ARG ...] -exec_as() { - local USER=$1 - shift 1 - - if [[ $USER = $(whoami) ]]; then - eval "$@" - else - sudo -u "$USER" "$@" - fi -} diff --git a/scripts/install b/scripts/install index 31b2a6a..247aaa1 100644 --- a/scripts/install +++ b/scripts/install @@ -79,7 +79,7 @@ fi # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add minidlna --log "/var/log/minidlna.log" +yunohost service add minidlna --log="/var/log/minidlna.log" --needs_exposed_ports="1900" #================================================= # CONFIGURE MINIDLNA diff --git a/scripts/restore b/scripts/restore index a405df0..dfcb67b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -75,7 +75,7 @@ ynh_systemd_action --action=restart --service_name=minidlna # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add minidlna --log "/var/log/minidlna.log" +yunohost service add minidlna --log="/var/log/minidlna.log" --needs_exposed_ports="1900" #================================================= # SEND A README FOR THE ADMIN diff --git a/scripts/upgrade b/scripts/upgrade index f2157dd..42872c7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -102,7 +102,7 @@ fi # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add minidlna --log "/var/log/minidlna.log" +yunohost service add minidlna --log="/var/log/minidlna.log" --needs_exposed_ports="1900" #================================================= # CONFIGURE MINIDLNA