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: A bit more documentation Created April 17, 2018, 7:58 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
« no previous file with comments | « modules/adblockplus/manifests/web/static/hook.pp ('k') | modules/adblockplus/templates/web/static.conf.erb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
+
« no previous file with comments | « modules/adblockplus/manifests/web/static/hook.pp ('k') | modules/adblockplus/templates/web/static.conf.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld