Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 #!/bin/sh | |
2 | |
3 # This script is a wrapper of accesible commands via ssh ForceCommand option | |
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 | |
mathias
2018/04/05 01:12:30
Instead of replacing "$@" here you should pass on
f.lopez
2018/04/10 02:45:40
Acknowledged.
| |
5 command="$1"; shift | |
6 case "$command" in | |
7 <%- @hooks.each do |command, values| -%> | |
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 %>) | |
9 /home/<%= @deploy_user %>/bin/<%= command %> "$@" | |
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 ;; | |
11 <%- end -%> | |
12 *) | |
13 echo "Sorry. Only these commands are available to you:" | |
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| -%> | |
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 %> | |
16 <%- end -%> | |
17 exit 1 | |
18 ;; | |
19 esac | |
OLD | NEW |