OLD | NEW |
(Empty) | |
| 1 #!/bin/sh |
| 2 # Puppet: <%= @title %> |
| 3 # This script is a wrapper of accesible hooks, defined via hiera and accessed |
| 4 # via ssh with the ForceCommand option. |
| 5 |
| 6 usage() |
| 7 { |
| 8 echo "Avaiable commands are:" |
| 9 echo "help" |
| 10 <% @hooks.keys.each do |key| -%> |
| 11 echo "<%= key %>" |
| 12 <% end -%> |
| 13 } |
| 14 |
| 15 command="$1"; shift |
| 16 case "$command" in |
| 17 "help") |
| 18 usage |
| 19 ;; |
| 20 <% @hooks.each do |command, values| -%> |
| 21 "<%= command %>") |
| 22 "<%= File.join(@wrapper_path, command) %>" "$@" |
| 23 ;; |
| 24 <% end -%> |
| 25 *) |
| 26 echo "Unrecognized command" |
| 27 usage |
| 28 exit 1 |
| 29 ;; |
| 30 esac |
| 31 |
OLD | NEW |