first import

This commit is contained in:
Flo 2017-04-29 19:25:46 +02:00
commit 98ce2ac0f9
2 changed files with 32 additions and 0 deletions

3
README.md Normal file
View 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
View 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