mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Do not fail on missing fail2ban config during the backup (#558)
* Do not fail on missing file during the backup * Fix for allow to backup without a fail2ban config file * Tab -> space consistency
This commit is contained in:
parent
d9a18d75de
commit
6bfcedfe1d
1 changed files with 10 additions and 2 deletions
|
@ -60,8 +60,16 @@ ynh_backup() {
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Be sure the source path is not empty
|
# Be sure the source path is not empty
|
||||||
[[ -e "${SRC_PATH}" ]] || {
|
[[ -e "${SRC_PATH}" ]] || {
|
||||||
echo "Source path '${SRC_PATH}' does not exist" >&2
|
echo "!!! Source path '${SRC_PATH}' does not exist !!!" >&2
|
||||||
return 1
|
|
||||||
|
# This is a temporary fix for fail2ban config files missing after the migration to stretch.
|
||||||
|
if echo "${SRC_PATH}" | grep --quiet "/etc/fail2ban"
|
||||||
|
then
|
||||||
|
touch "${SRC_PATH}"
|
||||||
|
echo "The missing file will be replaced by a dummy one for the backup !!!" >&2
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Transform the source path as an absolute path
|
# Transform the source path as an absolute path
|
||||||
|
|
Loading…
Add table
Reference in a new issue