Is it possible to automate the deletion of the ip_bans file? I’d like to create a UI button or a time based automation to delete this file.
Thank you.
Is it possible to automate the deletion of the ip_bans file? I’d like to create a UI button or a time based automation to delete this file.
Thank you.
Deleting ip_bans.yaml requires a restart of HA for it to take effect. So I doubt it. Anyway, if someone has a solution, I would like to know too.
@francisp You can automate the reboot of HA by calling homeassistant.restart service
@tom_l thank you, same reason why I’m looking for this - I’ll track this FR.
I know, but it is not always wanted.
Seems I voted for that FR already, just forgot about it.
How to automatically delete ip_bans.yaml every day at 17:05?
shell_command:
delete_ipbans: 'su root -c rm /homeassistant/ipbans.yaml'
Unfortunately the automation does not delete the ipbans.yaml file. Probably a rights issue.
Anyone a solution ?
This is a great idea,
I got this working with the below:
shell_command:
delete_ipbans: 'rm ip_bans.yaml'
I didn’t need sudo or su. the context of the shell seems to be the /homeassistant directory so you don’t need to supply it.