shell script

###config

env_dir="testenv-1"
env_path_prefix="mydepttestenv"

hk='hk'
ny='ny'
ldn='ldn'

ldn_file_path="/opt/eFX/apps/$env_path_prefix/mte-uips*/current/config/env/$env_dir/ldn/mte-uips/http.mte-uips-testenv.hsbc.keytab"
hk_file_path="/opt/eFX/apps/$env_path_prefix/mte-uips*/current/config/env/$env_dir/hk/mte-uips/HBAP-GBMHKMTEUIPStestenv.keytab"
ny_file_path="/opt/eFX/apps/$env_path_prefix/mte-uips*/current/config/env/$env_dir/ny/mte-uips/http.mte-uips-testenv-test.cn.keytab"


output_path="/opt/eFX/apps/$env_path_prefix/common/security/"
output_file='http.mte-uips-testenv1.keytab'

###start for deploy
clear
for server in $(echo usnyfxevos06.test.cn usnyfxevos05.test.cn usnjfxevos06.test.cn  usnjfxevos05.test.cn)
    do
        #echo -e "\n===Start distribute security folder to $server==="
                ssh -q $server mkdir -p "$output_path$ny/ccs-generic-data-service/"
                ssh -q  $server cp $ny_file_path   "$output_path$ny/ccs-generic-data-service/$output_file"
        target_file=$output_path$ny/ccs-generic-data-service/$output_file
         ssh -q $server "if [ -f $target_file ] ; then echo ' File found in server $server'; else echo 'File not found in server $server'; fi"
        #echo -e "\n===Finish distribute security folder to $server==="
    done

for server in $(echo hkp3plg139o.test.cn hkp3plg138o.test.cn hkc6plg139o.test.cn  hkc6plg138o.test.cn)
    do
        #echo -e "\n===Start distribute security folder to $server==="
                ssh -q $server mkdir -p "$output_path$hk/ccs-generic-data-service/"
                ssh -q $server cp $hk_file_path   "$output_path$hk/ccs-generic-data-service/$output_file"
        target_file=$output_path$hk/ccs-generic-data-service/$output_file
         ssh -q $server "if [ -f $target_file ] ; then echo ' File found in server $server'; else echo 'File not found in server $server'; fi"
       # echo -e "\n===Finish distribute security folder to $server==="
    done

for server in $(echo gbl10309.systemstest.cn  gbl10308.systemstest.cn gbl10293.systemstest.cn gbl10292.systemstest.cn)
    do
        #echo -e "\n===Start distribute security folder to $server==="
                ssh -q $server mkdir -p "$output_path$ldn/ccs-generic-data-service/"
                ssh -q $server cp $ldn_file_path   "$output_path$ldn/ccs-generic-data-service/$output_file"
        target_file=$output_path$ldn/ccs-generic-data-service/$output_file
         ssh -q $server "if [ -f $target_file ] ; then echo ' File found in server $server'; else echo 'File not found in server $server'; fi"
       # echo -e "\n===Finish distribute security folder to $server==="
    done
發佈了122 篇原創文章 · 獲贊 125 · 訪問量 32萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章