1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00
ctrl/doc/example-messages/create-and-execute-bash-script-with-heredoc.yaml
2022-03-11 11:44:19 +01:00

34 lines
558 B
YAML

---
- toNodes:
- ship1
- ship2
method: REQCliCommand
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: REQToFile
ACKTimeout: 5
retries: 120
replyACKTimeout: 5
replyRetries: 3
methodTimeout: 5
directory: system
fileName: system.log