| Index: modules/adblockplus/templates/web/hooks_wrapper.sh.erb |
| =================================================================== |
| new file mode 100644 |
| --- /dev/null |
| +++ b/modules/adblockplus/templates/web/hooks_wrapper.sh.erb |
| @@ -0,0 +1,31 @@ |
| +#!/bin/sh |
| +# Puppet: <%= @title %> |
| +# This script is a wrapper of accesible hooks, defined via hiera and accessed |
| +# via ssh with the ForceCommand option. |
| + |
| +usage() |
| +{ |
| + echo "Avaiable commands are:" |
| + echo "help" |
| +<% @hooks.keys.each do |key| -%> |
| + echo "<%= key %>" |
| +<% end -%> |
| +} |
| + |
| +command="$1"; shift |
| +case "$command" in |
| + "help") |
| + usage |
| + ;; |
| +<% @hooks.each do |command, values| -%> |
|
mathias
2018/04/17 15:57:13
Why the double space here?
f.lopez
2018/04/17 18:02:22
Acknowledged.
|
| +"<%= command %>") |
| + <%= scope.function_join([[@wrapper_path, command], "/"]) %> "$@" |
|
mathias
2018/04/17 15:57:14
Why not use Ruby's very own join method here?
Also
f.lopez
2018/04/17 18:02:22
Acknowledged.
|
| + ;; |
| +<% end -%> |
| + *) |
| + echo "Unrecognized command" |
| + usage |
| + exit 1 |
| + ;; |
| +esac |
| + |