Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/templates/web/hooks_wrapper.sh.erb

Issue 29733731: #7320 - Introduce helpcenter role (Closed)
Patch Set: For comments 8 and 9 Created April 17, 2018, 6:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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| -%>
+"<%= command %>")
+ "<%= File.join(@wrapper_path, command) %>" "$@"
+ ;;
+<% end -%>
+ *)
+ echo "Unrecognized command"
+ usage
+ exit 1
+ ;;
+esac
+

Powered by Google App Engine
This is Rietveld