]> git.madduck.net Git - puppet/acmessl.git/blob - templates/dehydrated-wrapper.epp

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

initial checkin
[puppet/acmessl.git] / templates / dehydrated-wrapper.epp
1 #!/bin/sh
2 set -eu
3
4 LOGDIR="<%= $logsdir %>"
5
6 args_to_filename() {
7   echo "$@" | sed -e "s,--,,g;s, ,_,g"
8 }
9
10 get_datestamp() {
11   date +%F-%H-%M-%S
12 }
13
14 if [ "$1" = "--log" ]; then
15   shift
16   exec >$LOGDIR/$(get_datestamp)-$(args_to_filename "$@").log 2>&1
17 fi
18
19 export _DEHYDRATED_DIR="${0%/*}"
20 case "$_DEHYDRATED_DIR" in
21   (/*) :;;
22   (*) _DEHYDRATED_DIR="$(realpath $_DEHYDRATED_DIR)";;
23 esac
24 exec dehydrated --config "${_DEHYDRATED_DIR}/dehydrated.conf" "$@"