Ignore:
Timestamp:
Jun 15, 2016 6:29:00 AM (8 years ago)
Author:
raasch
Message:

adjustments for using HLRN ssh-keys

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mbuild

    r1842 r1944  
    2222# Current revisions:
    2323# ------------------
    24 #
     24# adjustments for using HLRN ssh-keys
    2525#
    2626# Former revisions:
     
    682682
    683683
     684       # DETERMINE SSH-KEY TO BE USED
     685    ssh_key=""
     686    line=""
     687    grep  "$remote_host_string" $config_file | grep "%ssh_key "  >  $tmp_mbuild
     688    while read line1
     689    do
     690
     691       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
     692       then
     693          line="$line1"
     694       fi
     695
     696       if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     697       then
     698          ssh_key="-i $HOME/.ssh/`echo $line | cut -d" " -s -f2`"
     699       fi
     700
     701    done < $tmp_mbuild
     702
     703
     704
    684705       # IN CASE OF PARALLEL EXECUTION (COMPILER FOR PARALLEL EXECUTION),
    685706       # A SERIAL COMPILERNAME MUST BE DETERMINED ALSO
     
    11121133          if [[ $remote_host != lctit ]]
    11131134          then
    1114              ssh  ${remote_username}@${remote_address} "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"
     1135             ssh  $ssh_key  ${remote_username}@${remote_address} "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"
    11151136          else
    11161137                # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
     
    11181139          fi
    11191140
    1120           scp  ${local_source_path}/${mainprog}_sources.tar  ${remote_username}@${remote_address}:${remote_md}/${mainprog}_sources.tar
     1141          scp  $ssh_key ${local_source_path}/${mainprog}_sources.tar  ${remote_username}@${remote_address}:${remote_md}/${mainprog}_sources.tar
    11211142
    11221143
     
    11261147          if [[ $remote_host != lctit ]]
    11271148          then
    1128              ssh  ${remote_username}@${remote_address}  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"
     1149             ssh  $ssh_key  ${remote_username}@${remote_address}  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"
    11291150          else
    11301151                # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
     
    11371158          if [[ $remote_host != lctit ]]
    11381159          then
    1139              ssh  ${remote_username}@${remote_address}  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"
     1160             ssh  $ssh_key  ${remote_username}@${remote_address}  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"
    11401161          else
    11411162                # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
     
    11981219          else
    11991220
    1200              echo "$init_cmds $module_calls cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_address} 2>&1 | tee ${remote_host}_last_make_protokoll
     1221             echo "$init_cmds $module_calls cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  $ssh_key  ${remote_username}@${remote_address} 2>&1 | tee ${remote_host}_last_make_protokoll
    12011222
    12021223          fi
     
    12311252          if [[ $remote_host != lctit ]]
    12321253          then
    1233              ssh  ${remote_username}@${remote_address}  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  ${mainprog}  *.f90 *.o *.mod"
     1254             ssh  $ssh_key  ${remote_username}@${remote_address}  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  ${mainprog}  *.f90 *.o *.mod"
    12341255          else
    12351256                # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
     
    12511272          if [[ $remote_host != lctit ]]
    12521273          then
    1253              ssh  ${remote_username}@${remote_address} "[[ ! -d ${remote_ud} ]]  &&  (echo \"  *** ${remote_ud} will be created\"; mkdir -p  ${remote_ud}); [[ ! -d ${remote_ud}/../SCRIPTS ]]  &&  (echo \"  *** ${remote_ud}/../SCRIPTS will be created\"; mkdir -p ${remote_ud}/../SCRIPTS)"
     1274             ssh  $ssh_key  ${remote_username}@${remote_address} "[[ ! -d ${remote_ud} ]]  &&  (echo \"  *** ${remote_ud} will be created\"; mkdir -p  ${remote_ud}); [[ ! -d ${remote_ud}/../SCRIPTS ]]  &&  (echo \"  *** ${remote_ud}/../SCRIPTS will be created\"; mkdir -p ${remote_ud}/../SCRIPTS)"
    12541275          else
    12551276                # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
     
    12581279
    12591280             # COPY SHELL-SCRIPTS
    1260           scp  batch_scp mbuild mrun process_dvr_output .dvrserver.config subjob ${remote_username}@${remote_address}:${remote_ud}/../SCRIPTS  >  /dev/null
     1281          scp  $ssh_key  batch_scp mbuild mrun process_dvr_output .dvrserver.config subjob ${remote_username}@${remote_address}:${remote_ud}/../SCRIPTS  >  /dev/null
    12611282
    12621283          cd  -  > /dev/null
     
    12651286
    12661287             # COPY UTILITY-ROUTINES
    1267           scp  Makefile  *.f90  ${remote_username}@${remote_address}:${remote_ud}  >  /dev/null
     1288          scp  $ssh_key  Makefile  *.f90  ${remote_username}@${remote_address}:${remote_ud}  >  /dev/null
    12681289
    12691290
     
    13221343          else
    13231344
    1324              echo "$init_cmds $module_calls cd ${remote_ud}; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_address} 2>&1 | tee ${remote_host}_last_make_protokoll
     1345             echo "$init_cmds $module_calls cd ${remote_ud}; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  $ssh_key  ${remote_username}@${remote_address} 2>&1 | tee ${remote_host}_last_make_protokoll
    13251346
    13261347          fi
Note: See TracChangeset for help on using the changeset viewer.