From 6cfcd8ffa975dd25e33c7cbd68a589fb27d14cd5 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 13 Jan 2019 18:24:58 +0100 Subject: [PATCH] English translation and typo --- scripts/backup | 5 ++--- scripts/install | 46 ++++++++++++++++++++++++++-------------------- scripts/remove | 12 +++++------- scripts/restore | 21 ++++++++++++++------- scripts/upgrade | 21 ++++++++++++--------- 5 files changed, 59 insertions(+), 46 deletions(-) diff --git a/scripts/backup b/scripts/backup index a6f5839..0b6ccb7 100644 --- a/scripts/backup +++ b/scripts/backup @@ -30,20 +30,19 @@ version=$(ynh_app_setting_get $app version) # BACKUP OF THE APT SOURCE #================================================= -# Copie des fichiers spécifiques à l'application if [ $version = "B" ] then ynh_backup "/etc/apt/sources.list.d/minidlna.list" fi #================================================= -# BACKUP OF THE INOTIFY'S CONFIG +# BACKUP OF INOTIFY'S CONFIG #================================================= ynh_backup "/etc/sysctl.d/90-inotify_minidlna.conf" #================================================= -# BACKUP OF THE CONFIG OF MINIDLNA +# BACKUP OF MINIDLNA CONFIGURATION #================================================= ynh_backup "/etc/minidlna.conf" diff --git a/scripts/install b/scripts/install index b4d7865..e9d74df 100644 --- a/scripts/install +++ b/scripts/install @@ -13,7 +13,8 @@ source /usr/share/yunohost/helpers # MANAGE FAILURE OF THE SCRIPT #================================================= -ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est détectée. +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST @@ -22,6 +23,13 @@ ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est dét version="$YNH_APP_ARG_VERSION" app=$YNH_APP_INSTANCE_NAME +#================================================= +# STORE SETTINGS FROM MANIFEST +#================================================= + +ynh_app_setting_set $app version ${version:0:1} +ynh_app_setting_set $app overwrite_settings "1" + #================================================= # CHECK THE DEBIAN'S CODENAME #================================================= @@ -35,17 +43,15 @@ test -z "$codename" && (ynh_die "codename empty") # FIND AND OPEN A PORT #================================================= -port=$(ynh_find_port 48200) # Cherche un port libre. +# Find a free port +port=$(ynh_find_port 48200) -# Ouvre les ports dans le firewall +# Open ports ynh_exec_fully_quiet yunohost firewall allow --no-upnp TCP $port -ynh_exec_fully_quiet yunohost firewall allow --no-upnp UDP 1900 # Découverte SSDP pour UPNP. +# Discovery Protocol SSDP for UPNP. +ynh_exec_fully_quiet yunohost firewall allow --no-upnp UDP 1900 ynh_app_setting_set $app port $port -# Enregistre les infos dans la config YunoHost -ynh_app_setting_set $app version ${version:0:1} -ynh_app_setting_set $app overwrite_settings "1" - #================================================= # CREATE YUNOHOST.MULTIMEDIA DIRECTORY #================================================= @@ -58,14 +64,15 @@ ynh_multimedia_build_main_dir # INSTALL MINIDLNA #================================================= -# Installation du paquet minidlna et ses dépendances if [ ${version:0:1} = "B" ] -then # Installation de la version minidlna disponible dans backport. (En cas de problème avec la version actuelle des dépots) +then + # Install the backport version. (If you have issues with the standard version from the stable repository) ynh_replace_string "__CODENAME__" "$codename" ../conf/minidlna.list cp -a ../conf/minidlna.list /etc/apt/sources.list.d/ ynh_apt update ynh_package_install -t $codename-backports minidlna -else # Installation de la version minidlna des dépots courants. +else + # Install the standard version from debian repository ynh_apt update ynh_package_install minidlna fi @@ -75,25 +82,23 @@ ynh_app_setting_set $app version ${version:0:1} # INCREASE INOTIFY'S LIMITS #================================================= -# Augmentation du nombre maximum de fichiers surveillés par inotify. +# Increase the maximum number of files inotify can monitor. cp -a ../conf/90-inotify_minidlna.conf /etc/sysctl.d/ -# Et rechargement de la config du noyau. +# Then, reload the kernel configuration. if ! IS_PACKAGE_CHECK; then sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf fi #================================================= -# ENABLE SERVICE IN ADMIN PANEL +# ADVERTISE SERVICE IN ADMIN PANEL #================================================= -# Ajoute le service au monitoring de Yunohost. yunohost service add minidlna --log "/var/log/minidlna.log" #================================================= # CONFIGURE MINIDLNA #================================================= -# Modifie la configuration de minidlna ynh_replace_string "^#*media_dir=.*" "media_dir=/home/yunohost.multimedia/share" /etc/minidlna.conf ynh_replace_string "^#*port=.*" "port=$port" /etc/minidlna.conf friendly_name="Yunohost DLNA" @@ -103,13 +108,14 @@ root_container="B" ynh_replace_string "^#*root_container=.*" "root_container=$root_container" /etc/minidlna.conf ynh_app_setting_set $app root_container "$root_container" ynh_replace_string "^#wide_links=.*" "wide_links=yes" /etc/minidlna.conf -ynh_store_file_checksum "/etc/minidlna.conf" # Enregistre la somme de contrôle du fichier de config + +# Calculate and store the config file checksum into the app settings +ynh_store_file_checksum "/etc/minidlna.conf" #================================================= -# RESTART MINIDLNA'S SERVICE +# RESTART MINIDLNA #================================================= -# Redémarre minidlna pour prendre en compte la nouvelle configuration ynh_systemd_action --action=restart --service_name=minidlna #================================================= @@ -122,6 +128,6 @@ MiniDLNA is going to serve the files present in the directory /home/yunohost.mul Please have a look to the documentation to learn more how to use MiniDLNA, https://yunohost.org/#/app_minidlna -If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/minidlna_ynh" +If you're facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/minidlna_ynh" ynh_send_readme_to_admin --app_message="$message" --recipients="root" diff --git a/scripts/remove b/scripts/remove index c0e4e42..826a7e8 100755 --- a/scripts/remove +++ b/scripts/remove @@ -20,21 +20,20 @@ port=$(ynh_app_setting_get $app port) #================================================= # STANDARD REMOVE #================================================= -# DISABLE SERVICE IN ADMIN PANEL +# REMOVE SERVICE FROM ADMIN PANEL #================================================= -# Retire le service du monitoring de Yunohost. -if yunohost service status | grep -q minidlna # Test l'existence du service dans Yunohost +# Check if the service is declared in YunoHost +if yunohost service status | grep -q minidlna then ynh_print_info "Remove minidlna service" >&2 yunohost service remove minidlna fi #================================================= -# CLOSE THE PORTS +# CLOSE PORTS #================================================= -# Ferme les ports dans le firewall ynh_exec_fully_quiet yunohost firewall disallow TCP $port ynh_exec_fully_quiet yunohost firewall disallow UDP 1900 @@ -51,11 +50,10 @@ ynh_secure_remove "/etc/apt/sources.list.d/minidlna.list" # REMOVE INOTIFY'S CONFIG #================================================= -# Suppression du paramètre inotify pour minidlna. if [ -e "/etc/sysctl.d/90-inotify_minidlna.conf" ]; then ynh_print_info "Delete kernel config" >&2 ynh_secure_remove "/etc/sysctl.d/90-inotify_minidlna.conf" - # Et rechargement de la config du noyau. + # Reload the kernel configuration. if ! IS_PACKAGE_CHECK; then sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf fi diff --git a/scripts/restore b/scripts/restore index eb4842d..7e40b28 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,7 +32,8 @@ port=$(ynh_app_setting_get $app port) #================================================= ynh_exec_fully_quiet yunohost firewall allow --no-upnp TCP $port -ynh_exec_fully_quiet yunohost firewall allow --no-upnp UDP 1900 # Découverte SSDP pour UPNP. +# Discovery Protocol SSDP for UPNP. +ynh_exec_fully_quiet yunohost firewall allow --no-upnp UDP 1900 #================================================= # CREATE YUNOHOST.MULTIMEDIA DIRECTORY @@ -45,13 +46,15 @@ ynh_multimedia_build_main_dir #================================================= if [ ${version:0:1} = "B" ] -then # Installation de la version minidlna disponible dans backport. (En cas de problème avec la version actuelle des dépots) +then + # Install the backport version. (If you have issues with the standard version from the stable repository) codename=$(ynh_debian_release) ynh_restore_file "/etc/apt/sources.list.d/minidlna.list" ynh_replace_string " [a-z]*-backports" " $codename-backports" /etc/apt/sources.list.d/minidlna.list ynh_apt update ynh_package_install -t $codename-backports minidlna -else # Installation de la version minidlna des dépots courants. +else + # Install the standard version from debian repository ynh_apt update ynh_package_install minidlna fi @@ -65,15 +68,19 @@ if ! IS_PACKAGE_CHECK; then sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf fi -ynh_secure_remove "/etc/minidlna.conf" # Supprime la config pour la remplacer par celle du backup +#================================================= +# RESTORE MINIDLNA CONFIGURATION +#================================================= + +# Delete the current config of minidlna, in order to replace it by the version from the backup +ynh_secure_remove "/etc/minidlna.conf" ynh_restore_file "/etc/minidlna.conf" ynh_systemd_action --action=restart --service_name=minidlna #================================================= -# ENABLE SERVICE IN ADMIN PANEL +# ADVERTISE SERVICE IN ADMIN PANEL #================================================= -# Ajoute le service au monitoring de Yunohost. yunohost service add minidlna --log "/var/log/minidlna.log" #================================================= @@ -86,6 +93,6 @@ MiniDLNA is going to serve the files present in the directory /home/yunohost.mul Please have a look to the documentation to learn more how to use MiniDLNA, https://yunohost.org/#/app_minidlna -If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/minidlna_ynh" +If you're facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/minidlna_ynh" ynh_send_readme_to_admin --app_message="$message" --recipients="root" diff --git a/scripts/upgrade b/scripts/upgrade index 37b2086..a5a669f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,13 +73,15 @@ ynh_multimedia_build_main_dir #================================================= if [ $version = "B" ] -then # Installation de la version minidlna disponible dans backport. (En cas de problème avec la version actuelle des dépots) +then + # Install the backport version. (If you have issues with the standard version from the stable repository) codename=$(ynh_debian_release) ynh_replace_string "__CODENAME__" "$codename" ../conf/minidlna.list cp -a ../conf/minidlna.list /etc/apt/sources.list.d/ ynh_apt update ynh_package_install -t $codename-backports minidlna -else # Installation de la version minidlna des dépots courants. +else + # Install the standard version from debian repository ynh_apt update ynh_package_install minidlna fi @@ -88,18 +90,17 @@ fi # INCREASE INOTIFY'S LIMITS #================================================= -# Augmentation du nombre maximum de fichiers surveillés par inotify. +# Increase the maximum number of files inotify can monitor. cp -a ../conf/90-inotify_minidlna.conf /etc/sysctl.d/ -# Et rechargement de la config du noyau. +# Then, reload the kernel configuration. if ! IS_PACKAGE_CHECK; then sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf fi #================================================= -# ENABLE SERVICE IN ADMIN PANEL +# ADVERTISE SERVICE IN ADMIN PANEL #================================================= -# Ajoute le service au monitoring de Yunohost. yunohost service add minidlna --log "/var/log/minidlna.log" #================================================= @@ -109,13 +110,16 @@ yunohost service add minidlna --log "/var/log/minidlna.log" # Overwrite the settings config file only if it's allowed if [ $overwrite_settings -eq 1 ] then - # Modifie la configuration de minidlna - ynh_backup_if_checksum_is_different "/etc/minidlna.conf" # Créé un backup du fichier de config si il a été modifié. + # Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. + ynh_backup_if_checksum_is_different "/etc/minidlna.conf" + ynh_replace_string "^#*media_dir=.*" "media_dir=/home/yunohost.multimedia/share" /etc/minidlna.conf ynh_replace_string "^#*port=.*" "port=$port" /etc/minidlna.conf ynh_replace_string "^#*friendly_name=.*" "friendly_name=$friendly_name" /etc/minidlna.conf ynh_replace_string "^#*root_container=.*" "root_container=$root_container" /etc/minidlna.conf ynh_replace_string "^#wide_links=.*" "wide_links=yes" /etc/minidlna.conf + + # Calculate and store the config file checksum into the app settings ynh_store_file_checksum "/etc/minidlna.conf" fi @@ -123,5 +127,4 @@ fi # RESTART MINIDLNA'S SERVICE #================================================= -# Redémarre minidlna pour prendre en compte la nouvelle configuration ynh_systemd_action --action=restart --service_name=minidlna