From 11eeb9a4013127bc934cd3e73acc318a943ba9ae Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Mon, 20 Mar 2017 17:39:35 +0100 Subject: [PATCH] _common.sh --- scripts/{.fonctions => _common.sh} | 7 +++++++ scripts/backup | 8 ++++---- scripts/install | 2 +- scripts/remove | 2 +- scripts/restore | 8 ++++---- scripts/upgrade | 2 +- 6 files changed, 18 insertions(+), 11 deletions(-) rename scripts/{.fonctions => _common.sh} (98%) diff --git a/scripts/.fonctions b/scripts/_common.sh similarity index 98% rename from scripts/.fonctions rename to scripts/_common.sh index 2243dd2..20e53fb 100755 --- a/scripts/.fonctions +++ b/scripts/_common.sh @@ -224,6 +224,13 @@ CHECK_MD5_CONFIG () { # Créé un backup du fichier de config si il a été modi fi } +#================================================= +# PACKAGE CHECK BYPASSING... +#================================================= + +IS_PACKAGE_CHECK () { # Détermine une exécution en conteneur (Non testé) + return uname -n | grep -c 'pchecker_lxc' +} #================================================= #================================================= diff --git a/scripts/backup b/scripts/backup index fd8538f..ef7c8e9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,12 +13,12 @@ set -eu # IMPORT GENERIC HELPERS #================================================= -if [ ! -e .fonctions ]; then +if [ ! -e _common.sh ]; then # Rapatrie le fichier de fonctions si il n'est pas dans le dossier courant - sudo cp ../settings/scripts/.fonctions ./.fonctions - sudo chmod a+rx .fonctions + sudo cp ../settings/scripts/_common.sh ./_common.sh + sudo chmod a+rx _common.sh fi -source .fonctions +source _common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/install b/scripts/install index feaaaea..823d786 100644 --- a/scripts/install +++ b/scripts/install @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -source .fonctions +source _common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/remove b/scripts/remove index a864fa9..16491d1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -source .fonctions +source _common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/restore b/scripts/restore index 0e7bdc1..59b101f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,12 +13,12 @@ set -eu # IMPORT GENERIC HELPERS #================================================= -if [ ! -e .fonctions ]; then +if [ ! -e _common.sh ]; then # Rapatrie le fichier de fonctions si il n'est pas dans le dossier courant - sudo cp ../settings/scripts/.fonctions ./.fonctions - sudo chmod a+rx .fonctions + sudo cp ../settings/scripts/_common.sh ./_common.sh + sudo chmod a+rx _common.sh fi -source .fonctions +source _common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d238e76..d616c71 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -source .fonctions +source _common.sh source /usr/share/yunohost/helpers #=================================================