From a0d0ac80bcc3dd37c0c5c7fe0df3edfacd5ab5d9 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 2 Dec 2020 13:15:30 +0100 Subject: [PATCH] Fix linter --- scripts/_common.sh | 22 ---------------------- scripts/backup | 2 -- scripts/install | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 18b1a0d..ad46f82 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,27 +1,5 @@ #!/bin/bash -#================================================= -# BACKUP -#================================================= - -HUMAN_SIZE () { # Transforme une taille en Ko en une taille lisible pour un humain - human=$(numfmt --to=iec --from-unit=1K $1) - echo $human -} - -CHECK_SIZE () { # Vérifie avant chaque backup que l'espace est suffisant - file_to_analyse=$1 - backup_size=$(du --summarize "$file_to_analyse" | cut -f1) - free_space=$(df --output=avail "/home/yunohost.backup" | sed 1d) - - if [ $free_space -le $backup_size ] - then - ynh_print_err "Espace insuffisant pour sauvegarder $file_to_analyse." - ynh_print_err "Espace disponible: $(HUMAN_SIZE $free_space)" - ynh_die "Espace nécessaire: $(HUMAN_SIZE $backup_size)" - fi -} - #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 3994989..8624205 100644 --- a/scripts/backup +++ b/scripts/backup @@ -37,7 +37,6 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -CHECK_SIZE "$final_path" ynh_backup --src_path="$final_path" #================================================= @@ -58,7 +57,6 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_print_info --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql -CHECK_SIZE "db.sql" #================================================= # BACKUP FAIL2BAN CONFIGURATION diff --git a/scripts/install b/scripts/install index 6153a84..6e4b383 100644 --- a/scripts/install +++ b/scripts/install @@ -166,7 +166,7 @@ done #================================================= ynh_script_progression --message="Installing wordpress plugins..." --weight=20 -wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document=$final_path/wp-cli.phar +ynh_exec_warn_less wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document=$final_path/wp-cli.phar wpcli_alias="php$phpversion $final_path/wp-cli.phar --allow-root --path=$final_path" $wpcli_alias plugin install simple-ldap-login