mirror of
https://github.com/postmannen/ctrl.git
synced 2025-03-15 10:57:42 +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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $1
|
|
||||||
echo $2
|
|
||||||
echo $3
|
|
||||||
|
|
||||||
nodes=$1
|
nodes=$1
|
||||||
shell=$2
|
shell=$2
|
||||||
command=$3
|
command=$3
|
||||||
|
@ -24,7 +20,7 @@ command=$3
|
||||||
IFS=',' read -r -a array <<<"$nodes"
|
IFS=',' read -r -a array <<<"$nodes"
|
||||||
|
|
||||||
function sendMessage() {
|
function sendMessage() {
|
||||||
cat >msg.yaml <<EOF
|
cat >msg-"$element".yaml <<EOF
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"toNodes": ["${element}"],
|
"toNodes": ["${element}"],
|
||||||
|
@ -53,5 +49,5 @@ EOF
|
||||||
|
|
||||||
for element in "${array[@]}"; do
|
for element in "${array[@]}"; do
|
||||||
sendMessage element "$command"
|
sendMessage element "$command"
|
||||||
cp msg.yaml ./readfolder
|
cp msg-"$element".yaml ./readfolder
|
||||||
done
|
done
|
||||||
|
|
|
@ -13,10 +13,6 @@ if [ -z "$3" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $1
|
|
||||||
echo $2
|
|
||||||
echo $3
|
|
||||||
|
|
||||||
nodes=$1
|
nodes=$1
|
||||||
shell=$2
|
shell=$2
|
||||||
command=$3
|
command=$3
|
||||||
|
@ -24,7 +20,7 @@ command=$3
|
||||||
IFS=',' read -r -a array <<<"$nodes"
|
IFS=',' read -r -a array <<<"$nodes"
|
||||||
|
|
||||||
function sendMessage() {
|
function sendMessage() {
|
||||||
cat >msg.yaml <<EOF
|
cat >msg-"$element".yaml <<EOF
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"toNodes": ["${element}"],
|
"toNodes": ["${element}"],
|
||||||
|
@ -52,6 +48,6 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
for element in "${array[@]}"; do
|
for element in "${array[@]}"; do
|
||||||
sendMessage element command
|
sendMessage element "$command"
|
||||||
nc -U ./tmp/steward.sock <msg.yaml
|
nc -U ./tmp/steward.sock <msg-"$element".yaml
|
||||||
done
|
done
|
Loading…
Add table
Reference in a new issue