mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
30 lines
663 B
Bash
Executable file
30 lines
663 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
. /usr/share/yunohost/helpers
|
|
|
|
do_pre_regen() {
|
|
pending_dir=$1
|
|
|
|
cd /usr/share/yunohost/conf/fail2ban
|
|
|
|
fail2ban_dir="${pending_dir}/etc/fail2ban"
|
|
mkdir -p "${fail2ban_dir}/filter.d"
|
|
mkdir -p "${fail2ban_dir}/jail.d"
|
|
|
|
cp yunohost.conf "${fail2ban_dir}/filter.d/yunohost.conf"
|
|
cp jail.conf "${fail2ban_dir}/jail.conf"
|
|
|
|
export ssh_port="$(yunohost settings get 'security.ssh.port')"
|
|
ynh_render_template "yunohost-jails.conf" "${fail2ban_dir}/jail.d/yunohost-jails.conf"
|
|
}
|
|
|
|
do_post_regen() {
|
|
regen_conf_files=$1
|
|
|
|
[[ -z "$regen_conf_files" ]] \
|
|
|| systemctl reload fail2ban
|
|
}
|
|
|
|
do_$1_regen ${@:2}
|