first import
This commit is contained in:
commit
98ce2ac0f9
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
||||
csc : cluster ssh command
|
||||
|
||||
simple script to execute command over ssh on remote hosts with specific DEBIAN_FRONTEND
|
29
csc
Executable file
29
csc
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/env sh
|
||||
|
||||
# csc : cluster ssh command
|
||||
# ./csc <command>
|
||||
# launch command over ssh on cluster hosts with specific DEBIAN FRONTEND
|
||||
|
||||
# TODO
|
||||
HOSTS_FILE="/home/flo/hosts.int"
|
||||
|
||||
CMD=$@
|
||||
|
||||
if [ -z "$CMD" ]
|
||||
then
|
||||
echo "command is missing"
|
||||
echo "USAGE: $0 <command>"
|
||||
exit
|
||||
fi
|
||||
|
||||
# see http://askubuntu.com/questions/506158/unable-to-initialize-frontend-dialog-when-using-ssh
|
||||
#FRONTEND="DEBIAN_FRONTEND=noninteractive"
|
||||
FRONTEND="TERM=$TERM DEBIAN_FRONTEND=dialog"
|
||||
#FRONTEND="DEBIAN_FRONTEND=readline"
|
||||
|
||||
echo "will do :"
|
||||
echo "for i in `cat $HOSTS_FILE`; do ssh -t \$i "$FRONTEND $CMD"; done"
|
||||
|
||||
for i in `cat $HOSTS_FILE`
|
||||
do echo; echo "********** $i / $CMD **********"; ssh -t $i "$FRONTEND $CMD"
|
||||
done
|
Loading…
Reference in New Issue
Block a user