]> TLD Linux GIT Repositories - packages/dehydrated.git/commitdiff
- added support for custom functions
authorMarcin Krol <hawk@tld-linux.org>
Sat, 28 Oct 2017 12:42:25 +0000 (12:42 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 28 Oct 2017 12:42:25 +0000 (12:42 +0000)
dehydrated.spec
hook.functions
hook.sh

index a6ac9df80a46673ef1c0e6ca5b745d95df05aee3..62f11b32ee32e1c5a49750ee9503bdfcfa0ccb24 100644 (file)
@@ -21,7 +21,8 @@ Source12:     06-hook.sh
 Source13:      07-contact.sh
 Source14:      hook.sh
 Source15:      hook.functions
-Source16:      hook.global
+Source16:      hook.custom_functions
+Source17:      hook.global
 Patch0:                tld.patch
 URL:           https://github.com/lukas2511/dehydrated
 BuildRequires: rpmbuild(macros) >= 1.713
@@ -74,7 +75,8 @@ cp -p %{SOURCE7} %{SOURCE8} %{SOURCE9} %{SOURCE10} \
        $RPM_BUILD_ROOT/etc/%{name}/conf.d/
 install -p %{SOURCE14} $RPM_BUILD_ROOT/etc/%{name}/hooks/hook.sh
 cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/%{name}/hooks/functions
-cp -p %{SOURCE16} $RPM_BUILD_ROOT/etc/%{name}/hooks.d/global
+cp -p %{SOURCE16} $RPM_BUILD_ROOT/etc/%{name}/hooks/custom_functions
+cp -p %{SOURCE17} $RPM_BUILD_ROOT/etc/%{name}/hooks.d/global
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -110,6 +112,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/conf.d/*.sh
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/domains.txt
 %attr(755,root,root) /etc/%{name}/hooks
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/hooks/custom_functions
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/hooks/functions
 %attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/hooks/hook.sh
 %attr(755,root,root) /etc/%{name}/hooks.d
index 15183d8acfea8d0539a01eed4dd73e5e5731ba8e..71b769a5e2437662ee1afbd82ca473aabeb2b397 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# This file contains base functions for dehydrated hook scripts.
+# This file contains base functions for dehydrated system hook scripts.
 # Please do not edit this file! It will be overwritten by package updates!
 # If you need to implement your own functions, take a look at
 # custom_functions file.
diff --git a/hook.sh b/hook.sh
index 283ed79671ed713418f255a4f522087164ab8724..d46a0646df4525a91486d21b3baea8c33adb1caf 100755 (executable)
--- a/hook.sh
+++ b/hook.sh
@@ -4,34 +4,44 @@
 # certificate is successfully deployed
 HOOKS_D="/etc/dehydrated/hooks.d"
 
-# Load fucntions
+# Load system fucntions
 . "/etc/dehydrated/hooks/functions"
+# Load custom fucntions
+. "/etc/dehydrated/hooks/custom_functions"
 
 HANDLER="${1}"
 shift
 case "${HANDLER}" in
 deploy_cert)
   deploy_cert "$@"
+  custom_deploy_cert "$@"
   ;;
 clean_challenge)
   clean_challenge "$@"
+  custom_clean_challenge "$@"
   ;;
 deploy_challenge)
   deploy_challenge "$@"
+  custom_deploy_challenge "$@"
   ;;
 invalid_challenge)
   invalid_challenge "$@"
+  custom_invalid_challenge "$@"
   ;;
 request_failure)
   request_failure "$@"
+  custom_request_failure "$@"
   ;;
 unchanged_cert)
   unchanged_cert "$@"
+  custom_unchanged_cert "$@"
   ;;
 startup_hook)
   startup_hook "$@"
+  custom_startup_hook "$@"
   ;;
 exit_hook)
   exit_hook "$@"
+  custom_exit_hook "$@"
   ;;
 esac