mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
enhancement: fix file perms and make sure the folder exists
This commit is contained in:
parent
21531281e1
commit
fe1d18990f
1 changed files with 5 additions and 1 deletions
|
@ -100,9 +100,13 @@ ignoreregex =
|
|||
ynh_add_config --template="f2b_jail.conf" --destination="/etc/fail2ban/jail.d/$app.conf"
|
||||
ynh_add_config --template="f2b_filter.conf" --destination="/etc/fail2ban/filter.d/$app.conf"
|
||||
|
||||
# Create the logfile if it doesn't exist, as fail2ban require an existing file
|
||||
# Create the folder and logfile if they doesn't exist,
|
||||
# as fail2ban require an existing logfile before configuration
|
||||
mkdir -p "/var/log/$app"
|
||||
if [ ! -f "$logpath" ]; then
|
||||
touch "$logpath"
|
||||
chown -R "$app:$app" "$logpath"
|
||||
chmod -R u=rwX,g=rX,o= "$logpath"
|
||||
fi
|
||||
|
||||
ynh_systemd_action --service_name=fail2ban --action=reload --line_match="(Started|Reloaded) Fail2Ban Service" --log_path=systemd
|
||||
|
|
Loading…
Add table
Reference in a new issue