araujofrancisco / pihole-group

Script to all enable/disable docker pihole group.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Script to all enable/disable docker pihole group.

License:MIT License


Languages

Language:Shell 100.0%