Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Bash by venom ( 13 years ago )
#!/bin/bash
#
#
#VARIABLES##################################################
##
##
##
VMLIST=`pwd`/vmlist.txt
VAR=1  #Variable that contains name of server
STATE=0
ls -al $VMLIST
LAST=`tail -1 $VMLIST`
STRING=`head -$VAR $VMLIST | tail -1` # Contain server name
TEMP_STRING="server" # Temp string contain test server name
TAR_NAME=`pwd`/tar_name.tar.gz  #Tar package name
TEMP_DIR="/tmp/vmware_tmp"
echo "Tar package name" $TAR_NAME
echo "Last is :"  $LAST
echo "String is :" $STRING

##############################################################

##############################################################
##
## Select server name from file
##
while [ "$LAST" != "$STRING" ]
do
echo "String is"
STRING=`head -$VAR $VMLIST | tail -1`
VAR=$[$VAR+1]
##
##
##
#############################################################
echo "Connecting to " $STRING " ... "
ssh $STRING 'uname -a && mkdir /tmp/vmware_tmp'
scp localhost:$TAR_NAME $STRING:$TEMP_DIR





################################################################
done

 

Revise this Paste

Your Name: Code Language: