mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
extract logpath from /etc/fail2ban/jail.d/$app.conf
Co-authored-by: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com>
This commit is contained in:
parent
5194180277
commit
38415db273
1 changed files with 1 additions and 8 deletions
|
@ -104,14 +104,7 @@ ignoreregex =
|
|||
# "$logpath" using the one in the package's conf/f2b_jail.conf template
|
||||
if [ -z "$logpath" ]; then
|
||||
# the first sed deletes possibles spaces and the second one extract the path
|
||||
logpath=$(grep logpath "$YNH_APP_BASEDIR/conf/f2b_jail.conf" | sed "s/ //g" | sed "s/logpath=//g")
|
||||
# replace any '__VAR__' by their real variable using ynh_replace_vars
|
||||
# in some hacky way because ynh_replace_vars supports only files ^^'
|
||||
tempdir="$(mktemp -d)"
|
||||
echo "$logpath" > "$tempdir/process-logpath"
|
||||
ynh_replace_vars --file="$tempdir/process-logpath"
|
||||
logpath="$(cat "$tempdir/process-logpath")"
|
||||
rm -r "$tempdir"
|
||||
logpath=$(grep logpath "/etc/fail2ban/jail.d/$app.conf" | sed "s/ //g" | sed "s/logpath=//g")
|
||||
fi
|
||||
|
||||
# Create the folder and logfile if they doesn't exist,
|
||||
|
|
Loading…
Add table
Reference in a new issue