diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2015-06-16 07:45:53 +0100 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2015-06-16 07:45:53 +0100 |
commit | 8941d07b8b8d6d3a6c001f36b4f931111ad18cb4 (patch) | |
tree | a9651c37d5610aafe30cb8af0c10c15cd690fff9 | |
parent | 593881742424f3499f32cc75d86786e7f948b2a1 (diff) | |
download | vyatta-cfg-system-8941d07b8b8d6d3a6c001f36b4f931111ad18cb4.tar.gz vyatta-cfg-system-8941d07b8b8d6d3a6c001f36b4f931111ad18cb4.zip |
vyatta-cfg-system: prevent deletion of system based post-hook symlinks
Any system based symlinks installed in the /etc/commit/post-hooks.d
directory were being deleted on either the initial start of the system
or subsequent reboots. This commit resolves this by excluding these
from the deletion process, while still tidying up other non system
symlinks.
This is required for bug #538 (enhancement request) to function as
intended and also enables the Vyatta bug fix 4718 (enhancement), to log
successful commits to syslog with commit type and user name, commited
on February 2012!
Bug #576 http://bugzilla.vyos.net/show_bug.cgi?id=576
-rwxr-xr-x | scripts/rl-system.init | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/rl-system.init b/scripts/rl-system.init index fac5fbc1..6a2b8d25 100755 --- a/scripts/rl-system.init +++ b/scripts/rl-system.init @@ -210,8 +210,17 @@ start () { # note that this approach only supports hooks that are "configured", # i.e., it does not support hooks that need to always be present. cpostdir=$(cli-shell-api getPostCommitHookDir) + + # exclude commits hooks from vyatta-cfg + excluded="10vyatta-log-commit.pl 99vyos-user-postcommit-hooks" + if [ -d "$cpostdir" ]; then - rm -f $cpostdir/* + for f in $cpostdir/* + do + if [[ ! $excluded =~ $(basename $f) ]]; then + rm -f $cpostdir/$(basename $f) + fi + done fi ## Clear out apt config file--it will be filled in by config load |