1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2025-01-08 13:09:16 +00:00
ctrl/doc/example-messages/create-and-execute-bash-script-with-heredoc.yaml

35 lines
550 B
YAML
Raw Permalink Normal View History

2022-03-11 10:44:19 +00:00
---
- toNodes:
- ship1
- ship2
method: cliCommand
2022-03-11 10:44:19 +00:00
methodArgs:
- "bash"
- "-c"
- |
cat <<-"EOF" >test.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "error: No argument supplied, give the hostname as the only argument"
exit 1
fi
touch $1
echo "sorry..." > $1
EOF
chmod +x test.sh
./test.sh WHOOPS.txt
replyMethod: file
2022-03-11 10:44:19 +00:00
ACKTimeout: 5
retries: 120
replyACKTimeout: 5
replyRetries: 3
methodTimeout: 5
directory: system
fileName: system.log