Changeset 1944 for palm


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

adjustments for using HLRN ssh-keys

Location:
palm/trunk/SCRIPTS
Files:
3 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
  • palm/trunk/SCRIPTS/mrun

    r1941 r1944  
    2222# Current revisions:
    2323# ------------------
    24 #
     24# adjustments for using HLRN ssh-keys
    2525#
    2626# Former revisions:
     
    11831183
    11841184
     1185    # DETERMINE THE SSH-OPTION IN CASE THAT AN SSH-KEY IS EXPLICITLY GIVEN IN THE
     1186    # CONFIG-FILE
     1187 if [[ "$ssh_key" != "" ]]
     1188 then
     1189    ssh_key="-i $HOME/.ssh/$ssh_key"
     1190 fi
     1191
     1192
    11851193    # SET DEFAULT-QUEUE, IF NOT GIVEN
    11861194 if [[ $queue = none ]]
  • palm/trunk/SCRIPTS/subjob

    r1941 r1944  
    2323# Current revisions:
    2424# ------------------
    25 #
     25# adjustments for using HLRN ssh-keys
    2626#
    2727# Former revisions:
     
    15941594          scp  $PORTOPT  $job_to_send  ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost
    15951595       else
    1596           scp  $PORTOPT  $job_to_send  ${remote_user}@${remote_address}:${job_catalog}/$job_on_remhost
     1596          scp  $ssh_key  $PORTOPT  $job_to_send  ${remote_user}@${remote_address}:${job_catalog}/$job_on_remhost
    15971597       fi
    15981598       if [[ $? = 1 ]]
     
    16241624          /usr/bin/ssh  $SSH_PORTOPT $remote_address  -l $remote_user  "$init_cmds $module_calls cd $job_catalog; $submcom $job_on_remhost"
    16251625       else
    1626           ssh  $SSH_PORTOPT $remote_address  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
     1626          ssh  $ssh_key  $SSH_PORTOPT $remote_address  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
    16271627       fi
    16281628
Note: See TracChangeset for help on using the changeset viewer.