mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
updated scripts
This commit is contained in:
parent
541f243067
commit
e1771e9800
2 changed files with 5 additions and 13 deletions
|
@ -13,10 +13,6 @@ if [ -z "$3" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo $1
|
||||
echo $2
|
||||
echo $3
|
||||
|
||||
nodes=$1
|
||||
shell=$2
|
||||
command=$3
|
||||
|
@ -24,7 +20,7 @@ command=$3
|
|||
IFS=',' read -r -a array <<<"$nodes"
|
||||
|
||||
function sendMessage() {
|
||||
cat >msg.yaml <<EOF
|
||||
cat >msg-"$element".yaml <<EOF
|
||||
[
|
||||
{
|
||||
"toNodes": ["${element}"],
|
||||
|
@ -53,5 +49,5 @@ EOF
|
|||
|
||||
for element in "${array[@]}"; do
|
||||
sendMessage element "$command"
|
||||
cp msg.yaml ./readfolder
|
||||
cp msg-"$element".yaml ./readfolder
|
||||
done
|
||||
|
|
|
@ -13,10 +13,6 @@ if [ -z "$3" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo $1
|
||||
echo $2
|
||||
echo $3
|
||||
|
||||
nodes=$1
|
||||
shell=$2
|
||||
command=$3
|
||||
|
@ -24,7 +20,7 @@ command=$3
|
|||
IFS=',' read -r -a array <<<"$nodes"
|
||||
|
||||
function sendMessage() {
|
||||
cat >msg.yaml <<EOF
|
||||
cat >msg-"$element".yaml <<EOF
|
||||
[
|
||||
{
|
||||
"toNodes": ["${element}"],
|
||||
|
@ -52,6 +48,6 @@ EOF
|
|||
}
|
||||
|
||||
for element in "${array[@]}"; do
|
||||
sendMessage element command
|
||||
nc -U ./tmp/steward.sock <msg.yaml
|
||||
sendMessage element "$command"
|
||||
nc -U ./tmp/steward.sock <msg-"$element".yaml
|
||||
done
|
Loading…
Reference in a new issue