Syntax cleanup, removed some non-working SUID entries

This commit is contained in:
Emanuel Duss
2020-11-13 11:56:48 +01:00
parent bd1e3ce65d
commit 764b2685bc
16 changed files with 65 additions and 105 deletions

View File

@@ -3,32 +3,24 @@ description: |
This is the `check_by_ssh` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.
functions:
command:
- code: |
COMMAND='/usr/bin/id'
OUTPUT="output_file"
- description: The host example.net must return a certificate via TLS
code: |
COMMAND=id
OUTPUT=output_file
TF=$(mktemp)
echo "$COMMAND | tee \"$OUTPUT\"" > $TF
echo "$COMMAND | tee $OUTPUT" > $TF
chmod +x $TF
check_ssl_cert --curl-bin "$TF" -H example.com # example.com must provide TLS
cat $OUTPUT
suid:
- code: |
COMMAND='/usr/bin/id'
OUTPUT="output_file"
umask 022
TF=$(mktemp)
echo "$COMMAND | tee \"$OUTPUT\"" > $TF
chmod +x $TF
./check_ssl_cert --curl-bin "$TF" -H example.com # example.com must provide TLS
check_ssl_cert --curl-bin $TF -H example.net
cat $OUTPUT
sudo:
- code: |
COMMAND='/usr/bin/id'
OUTPUT="output_file"
umask 022
- description: The host example.net must return a certificate via TLS
code: |
COMMAND=id
OUTPUT=output_file
TF=$(mktemp)
echo "$COMMAND | tee \"$OUTPUT\"" > $TF
echo "$COMMAND | tee $OUTPUT" > $TF
chmod +x $TF
sudo check_ssl_cert --curl-bin "$TF" -H example.com # example.com must provide TLS
umask 022
check_ssl_cert --curl-bin $TF -H example.net
cat $OUTPUT
---