Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 968 Bytes

README.md

File metadata and controls

16 lines (13 loc) · 968 Bytes

pihole-group

Description

This script is mean to update pihole group to enable/disable when running on a docker container, the change is achived updating the gravity database directly using docker exec command. Intended to allow using cron to schedule job and enable/disable rules automatically.
Update the database only if current value is different from the parameter, this allow the script to return the affected rows that could be used for expanded automation.

Setting it up

Set the script to executable: chmod +x pihole-group.sh

Usage

pihole-group.sh < enable | disable > < group-name1,group-name2,group-name3 >
Multiple groups can be updated at once passing as second parameter comma separated list.
You might require root permissions to execute docker commands.

Notes

Depending on docker container setup you might require to change the pihole and database variables to point the right place.