In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
File: upload.sh
Path: $HOME/ggscript/ggupload
Function: this script will not be used directly, it is designed to satisfy other scripts for uploading information, and the corresponding file information is directly called within the script.
He reads the system configuration information in the system information configuration file sysinfo
Example
[detest#]
Ip-MTMyLjEyMS4xMDEuODYK
UserName-Z2dzCg==
PassWord-Z2dzxxxxxx
Port-MjIK
Path-L2RhdGExL2dncy9nZ3NlcnZlci9kaXJkZWYK
[# detest]
The above information is encrypted with base64 to ensure the security of the information. Obtain the IP user name, password, and port path.
And send the corresponding files to the corresponding machine.
#! / bin/bashif [$#-eq 0]; then echo "info host file checkf" exit 2fiif [$#-eq 1]; then echo "info host file checkf" exit 2fiif [$#-eq 1] Then echo "info host file checkf" exit 2fihost=$1file=$2checkf=$3cd $HOME/ggscript/ggupload#sed'/ "$host" /, / 5lapp'$checkf > infotmpcat $HOME/ggscript/ggupload/$checkf | awk'/'$host'#/,/#'$host'/ {if (I > 1) print x tersichi 0 Grep +}'> $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] do port=22done#echo $ip $pw $port $pathexpect-c "spawn scp-r-P $port $file $us@$ip:$path expect {\" * assword\ "{set timeout 300; send\" $pw\ r\ ";}\" yes/no\ "{send\" yes\ r\ "; exp_continue;}} expect eof"
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.