ramangrover29 | bfe4623 | 2013-05-30 23:16:32 -0700 | [diff] [blame] | 1 | USERNAME=$1 |
| 2 | if [ ! -d $MANAGIX_HOME/logs ]; |
| 3 | then |
| 4 | mkdir -p $MANAGIX_HOME/logs |
| 5 | fi |
| 6 | LOGDIR=$MANAGIX_HOME/logs |
| 7 | if [ $DAEMON == "false" ]; then |
| 8 | if [ -z $USERNAME ] |
| 9 | then |
| 10 | cmd_output=$(ssh $IP_LOCATION "$ENV $SCRIPT $ARGS" 2>&1 >/dev/null) |
| 11 | echo "ssh $IP_LOCATION $ENV $SCRIPT $ARGS" >> $LOGDIR/execute.log |
| 12 | echo "$cmd_output" |
| 13 | else |
| 14 | echo "ssh -l $USERNAME $IP_LOCATION $ENV $SCRIPT $ARGS" >> $LOGDIR/execute.log |
| 15 | cmd_output=$(ssh -l $USERNAME $IP_LOCATION "$ENV $SCRIPT $ARGS" 2>&1 >/dev/null) |
| 16 | echo "$cmd_output" |
| 17 | fi |
| 18 | else |
| 19 | if [ -z $USERNAME ]; |
| 20 | then |
| 21 | echo "ssh $IP_LOCATION $ENV $SCRIPT $ARGS &" >> $LOGDIR/execute.log |
| 22 | ssh $IP_LOCATION "$ENV $SCRIPT $ARGS" & |
| 23 | else |
| 24 | echo "ssh -l $USERNAME $IP_LOCATION $ENV $SCRIPT $ARGS &" >> $LOGDIR/execute.log |
| 25 | ssh -l $USERNAME $IP_LOCATION "$ENV $SCRIPT $ARGS" & |
| 26 | fi |
| 27 | fi |