bundles/sshmon: import from work repository
This commit is contained in:
parent
eaf268aea9
commit
c7362df6c4
12 changed files with 773 additions and 0 deletions
25
bundles/sshmon/files/sshmon
Normal file
25
bundles/sshmon/files/sshmon
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
# ^^^^ Because we need Bash arrays.
|
||||
|
||||
set -e
|
||||
|
||||
UNKNOWN=3
|
||||
|
||||
unset command
|
||||
declare -A command
|
||||
. /etc/sshmon.cfg
|
||||
|
||||
if [[ -z "$SSH_ORIGINAL_COMMAND" ]]
|
||||
then
|
||||
echo "No command given" >&2
|
||||
exit $UNKNOWN
|
||||
fi
|
||||
|
||||
execute=${command["$SSH_ORIGINAL_COMMAND"]}
|
||||
if [[ -z "$execute" ]]
|
||||
then
|
||||
echo "Unknown command" >&2
|
||||
exit $UNKNOWN
|
||||
fi
|
||||
|
||||
exec sh -c "$execute"
|
Loading…
Add table
Add a link
Reference in a new issue