haussli / rancid

RANCiD
Other
114 stars 42 forks source link

Add new variable PRECOMMIT_HOOK #19

Open jvaubourg opened 3 years ago

jvaubourg commented 3 years ago

I'm proposing a new variable PRECOMMIT_HOOK, to let admins execute commands on the configs before the commit. I need this to avoid unecessary commits (with their mails), juste because the occupation of the nvram slightly changed.

Example of lines which can be annoying:

sed '/^!Flash: harddisk:.*total/d' -i configs/*
sed '/^!Flash: nvram:.*total/d' -i configs/*
sed '/^!\s\+Not ready set/d' -i configs/*

I currently cheat by doing that in a DIFFSCRIPT script, but it's not really appropriate.

Thanks for your work!