LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help with 'expect' (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-expect-4175415602/)

geotor 07-08-2012 07:59 PM

Help with 'expect'
 
hi guys I am in need for some 'expect' scripting help

I have the following bash script and need to make this automated using the same password everytime (since i am configuring different deviced everytime, I can not use SSH Key for this)

Can anyone tell me how to integrate the 'expect' usages into this script so that MySecrectPass will be used to log into the ssh and transfer the files and get mac address:

please find the bits I need automated below

Code:

#Get the mac address
mac=$(echo "ip -o link show dev eth0  | sed 's/.*link\/ether \([0-9:a-f]*\).*/\1/g'" | ssh $ssh_args $login)

if [[ $mac == "" ]]; then
      exit
fi

 echo "CPE mac address == $mac"

scp $ssh_args -r system.cfg $login:/tmp/ 

scp $ssh_args cp ../XM* $login:/tmp/fw.bin


chrism01 07-08-2012 08:15 PM

Read this: https://www.linuxquestions.org/quest...rd-4175415027/


All times are GMT -5. The time now is 11:43 PM.