commit 98ce2ac0f96221b7bb65b32948bfee41d57fb109 Author: Flo Date: Sat Apr 29 19:25:46 2017 +0200 first import diff --git a/README.md b/README.md new file mode 100644 index 0000000..78a439b --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +csc : cluster ssh command + +simple script to execute command over ssh on remote hosts with specific DEBIAN_FRONTEND diff --git a/csc b/csc new file mode 100755 index 0000000..d5866bc --- /dev/null +++ b/csc @@ -0,0 +1,29 @@ +#!/bin/env sh + +# csc : cluster ssh command +# ./csc +# 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 " + 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