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. Set the script to executable: chmod +x pihole-group.sh
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. Depending on docker container setup you might require to change the pihole and database variables to point the right place.