mirror of
https://github.com/YunoHost-Apps/minidlna_ynh.git
synced 2024-09-03 19:36:34 +02:00
54 lines
1.7 KiB
Bash
54 lines
1.7 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# MANAGE FAILURE OF THE SCRIPT
|
|
#=================================================
|
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
set -eu
|
|
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
if [ ! -e _common.sh ]; then
|
|
# Rapatrie le fichier de fonctions si il n'est pas dans le dossier courant
|
|
sudo cp ../settings/scripts/_common.sh ./_common.sh
|
|
sudo chmod a+rx _common.sh
|
|
fi
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
version=$(ynh_app_setting_get $app version)
|
|
|
|
#=================================================
|
|
# SPECIFIC BACKUP
|
|
#=================================================
|
|
# 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" "${YNH_APP_BACKUP_DIR}/etc/apt/sources.list.d/minidlna.list"
|
|
fi
|
|
|
|
#=================================================
|
|
# BACKUP OF THE INOTIFY'S CONFIG
|
|
#=================================================
|
|
|
|
ynh_backup "/etc/sysctl.d/90-inotify_minidlna.conf" "${YNH_APP_BACKUP_DIR}/etc/sysctl.d/90-inotify_minidlna.conf"
|
|
|
|
#=================================================
|
|
# BACKUP OF THE CONFIG OF MINIDLNA
|
|
#=================================================
|
|
|
|
ynh_backup "/etc/minidlna.conf" "${YNH_APP_BACKUP_DIR}/etc/minidlna.conf"
|