Index: palm/trunk/SCRIPTS/mbuild
===================================================================
--- palm/trunk/SCRIPTS/mbuild	(revision 1842)
+++ palm/trunk/SCRIPTS/mbuild	(revision 1944)
@@ -22,5 +22,5 @@
 # Current revisions:
 # ------------------
-# 
+# adjustments for using HLRN ssh-keys
 # 
 # Former revisions:
@@ -682,4 +682,25 @@
 
 
+       # DETERMINE SSH-KEY TO BE USED
+    ssh_key=""
+    line=""
+    grep  "$remote_host_string" $config_file | grep "%ssh_key "  >  $tmp_mbuild
+    while read line1
+    do
+
+       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
+       then
+          line="$line1"
+       fi
+
+       if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
+       then
+          ssh_key="-i $HOME/.ssh/`echo $line | cut -d" " -s -f2`"
+       fi
+
+    done < $tmp_mbuild
+
+
+
        # IN CASE OF PARALLEL EXECUTION (COMPILER FOR PARALLEL EXECUTION),
        # A SERIAL COMPILERNAME MUST BE DETERMINED ALSO
@@ -1112,5 +1133,5 @@
           if [[ $remote_host != lctit ]]
           then
-             ssh  ${remote_username}@${remote_address} "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"
+             ssh  $ssh_key  ${remote_username}@${remote_address} "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"
           else
                 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
@@ -1118,5 +1139,5 @@
           fi
 
-          scp  ${local_source_path}/${mainprog}_sources.tar  ${remote_username}@${remote_address}:${remote_md}/${mainprog}_sources.tar
+          scp  $ssh_key ${local_source_path}/${mainprog}_sources.tar  ${remote_username}@${remote_address}:${remote_md}/${mainprog}_sources.tar
 
 
@@ -1126,5 +1147,5 @@
           if [[ $remote_host != lctit ]]
           then
-             ssh  ${remote_username}@${remote_address}  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"
+             ssh  $ssh_key  ${remote_username}@${remote_address}  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"
           else
                 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
@@ -1137,5 +1158,5 @@
           if [[ $remote_host != lctit ]]
           then
-             ssh  ${remote_username}@${remote_address}  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"
+             ssh  $ssh_key  ${remote_username}@${remote_address}  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"
           else
                 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
@@ -1198,5 +1219,5 @@
           else
 
-             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
+             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
 
           fi
@@ -1231,5 +1252,5 @@
           if [[ $remote_host != lctit ]]
           then
-             ssh  ${remote_username}@${remote_address}  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  ${mainprog}  *.f90 *.o *.mod"
+             ssh  $ssh_key  ${remote_username}@${remote_address}  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  ${mainprog}  *.f90 *.o *.mod"
           else
                 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
@@ -1251,5 +1272,5 @@
           if [[ $remote_host != lctit ]]
           then
-             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)"
+             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)"
           else
                 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS
@@ -1258,5 +1279,5 @@
 
              # COPY SHELL-SCRIPTS
-          scp  batch_scp mbuild mrun process_dvr_output .dvrserver.config subjob ${remote_username}@${remote_address}:${remote_ud}/../SCRIPTS  >  /dev/null
+          scp  $ssh_key  batch_scp mbuild mrun process_dvr_output .dvrserver.config subjob ${remote_username}@${remote_address}:${remote_ud}/../SCRIPTS  >  /dev/null
 
           cd  -  > /dev/null
@@ -1265,5 +1286,5 @@
 
              # COPY UTILITY-ROUTINES
-          scp  Makefile  *.f90  ${remote_username}@${remote_address}:${remote_ud}  >  /dev/null
+          scp  $ssh_key  Makefile  *.f90  ${remote_username}@${remote_address}:${remote_ud}  >  /dev/null
 
 
@@ -1322,5 +1343,5 @@
           else
 
-             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
+             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
 
           fi
