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

Delta Between Two Patch Sets: modules/adblockplus/templates/web/hooks_wrapper.sh.erb

Issue 29733731: #7320 - Introduce helpcenter role (Closed)
Left Patch Set: For comments 2 to 4 Created April 2, 2018, 10:36 p.m.
Right Patch Set: Make documentation right Created April 17, 2018, 8:03 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « modules/adblockplus/manifests/web/static/hook.pp ('k') | modules/adblockplus/templates/web/static.conf.erb » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #!/bin/sh 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.
2 5
3 # This script is a wrapper of accesible commands via ssh ForceCommand option 6 usage()
mathias 2018/04/05 01:12:31 This should mention that it is to ensure only the
f.lopez 2018/04/10 02:45:40 Acknowledged.
4 set -- $SSH_ORIGINAL_COMMAND 7 {
mathias 2018/04/05 01:12:30 Instead of replacing "$@" here you should pass on
f.lopez 2018/04/10 02:45:40 Acknowledged.
8 echo "Avaiable commands are:"
9 echo "help"
10 <% @hooks.keys.each do |key| -%>
11 echo "<%= key %>"
12 <% end -%>
13 }
14
5 command="$1"; shift 15 command="$1"; shift
6 case "$command" in 16 case "$command" in
7 <%- @hooks.each do |command, values| -%> 17 "help")
mathias 2018/04/05 01:12:31 I prefer when the template brackets (`<%`) are use
f.lopez 2018/04/10 02:45:40 Acknowledged.
8 <%= command %>) 18 usage
9 /home/<%= @deploy_user %>/bin/<%= command %> "$@" 19 ;;
mathias 2018/04/05 01:12:31 This should not repeat the convention from hook.pp
f.lopez 2018/04/10 02:45:39 Acknowledged.
10 ;; 20 <% @hooks.each do |command, values| -%>
11 <%- end -%> 21 "<%= command %>")
12 *) 22 "<%= File.join(@wrapper_path, command) %>" "$@"
13 echo "Sorry. Only these commands are available to you:" 23 ;;
mathias 2018/04/05 01:12:31 Please don't use personal articulation, stuff like
f.lopez 2018/04/10 02:45:40 Acknowledged.
14 <%- @hooks.keys.select { |key| key.to_s}.each do |value| -%> 24 <% end -%>
mathias 2018/04/05 01:12:30 Aren't the key's strings anyway? And even if not,
f.lopez 2018/04/10 02:45:40 Acknowledged.
15 echo <%= value %> 25 *)
16 <%- end -%> 26 echo "Unrecognized command"
17 exit 1 27 usage
18 ;; 28 exit 1
29 ;;
19 esac 30 esac
31
LEFTRIGHT

Powered by Google App Engine
This is Rietveld