Ogg Operations Optimization Script (12)-Information synchronization class--Information upload

Source: Internet
Author: User

files : upload.sh

path : $HOME/ggscript/ggupload

Function: The script will not be used directly, to meet other scripts to upload information and design, directly within the script to upload the corresponding file information

He reads system configuration information in the System Information Profile SysInfo

Example

[detest#]

Ip-mtmyljeyms4xmdeuodyk

username-z2dzcg==

Password-z2dzxxxxxx

Port-mjik

Path-l2rhdgexl2dncy9nz3nlcnzlci9kaxjkzwyk

[#detest]

The above information is encrypted with Base64, ensuring information security, obtaining IP username, password, and port path

#!/bin/bashif [ $# -eq 0 ]; then         echo  "INFO&NBSP;HOST&NBSP;FILE&NBSP;CHECKF"         exit 2fi  if [ $# -eq 1 ]; then        echo   "INFO&NBSP;HOST&NBSP;FILE&NBSP;CHECKF"         exit 2fiif  [ $# -eq 1 ]; then        echo  " INFO&NBSP;HOST&NBSP;FILE&NBSP;CHECKF "        exit 2fihost=$1file= $2checkf=$3cd  $HOME/ggscript/ggupload#sed   '/"$host"/,/5/p '   $CHECKF  >  infotmpcat  $HOME/ggscript/ggupload/$checkf  | awk  '/' $host ' #/,/# ' $host '/{if (i>1) print  x;x=$0;i++} '  >  $HOME/ggscript/ggupload/infotmpip= ' cat  $HOME/ggscript/ggupload/infotmp| grep -w  "Ip" |cut -d  "-"  -f 2 ' pw= ' cat  $HOME/ggscript/ggupload/infotmp|grep -w  "PassWord" |cut  -d  "-"  -f 2 ' port= ' cat  $HOME/ggscript/ggupload/infotmp|grep -w  "Port" |cut  -d  "-"  -f 2 ' us= ' cat  $HOME/ggscript/ggupload/infotmp|grep -w  "UserName" |cut  -d  "-"  -f 2 ' path= ' cat  $HOME/ggscript/ggupload/infotmp|grep -w  "path" |cut  -d  "-"  -f 2 ' echo  "code" echo  "ip= $ip" echo  "pw= $pw" echo  "port= $port" echo  "user=  $US" echo  "path= $path" echo  $ip  > tmpperl -MMIME::Base64  -ne  ' Print decode_base64 ($_) '  <  tmp > outip= ' cat out ' echo  $PW  > tmpperl -MMIME::Base64 -ne  ' print decode_base64 ($_) '  <   tmp > outpw= ' cat out ' echo  $port  > tmpperl -mmime::base64 - ne  ' Print dEcode_base64 ($_) '  <  tmp > outport= ' cat out ' echo  $US  >  tmpperl -mmime::base64 -ne  ' Print decode_base64 ($_)  <  tmp >  outus= ' cat out ' echo  $path  > tmpperl -MMIME::Base64 -ne  ' Print  decode_base64 ($_) '  <  tmp > outpath= ' cat out ' #echo   ' decode ' # echo  "ip= $ip" #echo   "pw= $pw" #echo   "port= $port" #echo   "user= $US" #echo   "path= $path" while  [ ${#port} -le 1 ]doport=22done#echo  $ip   $PW   $port   $pathexpect  -c    spawn scp -r -P  $port   $file  [email protected] $ip : $path   expect {    \ "*assword\"  {set timeout 300; send  \ "$PW \r\";}     \ "yes/no\"  {send \ "yes\r\";  exp_continue;}   }expect eof "


This article is from the "Netsman" blog, make sure to keep this source http://netsman.blog.51cto.com/5750076/1939643

Ogg Operations Optimization Script (12)-Information synchronization class--Information upload

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.