1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wordpress_ynh.git synced 2024-09-03 20:36:10 +02:00

Fix linter

This commit is contained in:
Kay0u 2020-12-02 13:15:30 +01:00
parent e24fe50fcc
commit a0d0ac80bc
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
3 changed files with 1 additions and 25 deletions

View file

@ -1,27 +1,5 @@
#!/bin/bash #!/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 # EXPERIMENTAL HELPERS
#================================================= #=================================================

View file

@ -37,7 +37,6 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
CHECK_SIZE "$final_path"
ynh_backup --src_path="$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_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql ynh_mysql_dump_db --database="$db_name" > db.sql
CHECK_SIZE "db.sql"
#================================================= #=================================================
# BACKUP FAIL2BAN CONFIGURATION # BACKUP FAIL2BAN CONFIGURATION

View file

@ -166,7 +166,7 @@ done
#================================================= #=================================================
ynh_script_progression --message="Installing wordpress plugins..." --weight=20 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="php$phpversion $final_path/wp-cli.phar --allow-root --path=$final_path"
$wpcli_alias plugin install simple-ldap-login $wpcli_alias plugin install simple-ldap-login