summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--debian/vyatta-cfg.postinst.in4
-rw-r--r--scripts/vyos-user-postcommit-hooks.sh5
-rw-r--r--scripts/vyos-user-precommit-hooks.sh6
4 files changed, 17 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 963450e..ac9f0cd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -110,6 +110,8 @@ sbin_SCRIPTS += scripts/vyatta-cfg-notify
sbin_SCRIPTS += scripts/vyatta-check-typeless-node.pl
sbin_SCRIPTS += scripts/vyatta-strip-migration-comments.pl
sbin_SCRIPTS += scripts/vyatta-log-commit.pl
+sbin_SCRIPTS += scripts/vyos-user-precommit-hooks.sh
+sbin_SCRIPTS += scripts/vyos-user-postcommit-hooks.sh
share_perl5_DATA = lib/Vyatta/Config.pm
share_perl5_DATA += lib/Vyatta/File.pm
diff --git a/debian/vyatta-cfg.postinst.in b/debian/vyatta-cfg.postinst.in
index 7ad9339..f840803 100644
--- a/debian/vyatta-cfg.postinst.in
+++ b/debian/vyatta-cfg.postinst.in
@@ -46,3 +46,7 @@ rm -f /etc/bash_completion.d/20vyatta-cfg
# create symlink for post commit hook
ln -sf /opt/vyatta/sbin/vyatta-log-commit.pl /etc/commit/post-hooks.d/10vyatta-log-commit.pl
+
+ln -s /opt/vyatta/sbin/vyos-user-precommit-hooks.sh /etc/commit/pre-hooks.d/99vyos-user-precommit-hooks
+ln -s /opt/vyatta/sbin/vyos-user-postcommit-hooks.sh /etc/commit/pre-hooks.d/99vyos-user-postcommit-hooks
+
diff --git a/scripts/vyos-user-postcommit-hooks.sh b/scripts/vyos-user-postcommit-hooks.sh
new file mode 100644
index 0000000..fd23f82
--- /dev/null
+++ b/scripts/vyos-user-postcommit-hooks.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if [ -d /config/scripts/commit/post-hooks.d/ ]; then
+ /bin/run-parts /config/scripts/commit/post-hooks.d
+fi
diff --git a/scripts/vyos-user-precommit-hooks.sh b/scripts/vyos-user-precommit-hooks.sh
new file mode 100644
index 0000000..cae38db
--- /dev/null
+++ b/scripts/vyos-user-precommit-hooks.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ -d /config/scripts/commit/pre-hooks.d/ ]; then
+ /bin/run-parts /config/scripts/commit/pre-hooks.d
+fi
+