config_display_ssh_fingerprints: adjust check for present host keys
[grml-autoconfig.git] / autoconfig.functions
index 9488f55..2736153 100755 (executable)
@@ -1121,6 +1121,22 @@ if checkbootparam 'ssh' ; then
    eoutdent
 fi
 }
+
+# }}}
+
+# {{{ display hostkeys of SSH server
+config_display_ssh_fingerprints() {
+  if ! ls /etc/ssh/ssh_host_\*_key >/dev/null 2>&1 ; then
+    return 0 # no SSH host keys present
+  fi
+
+  einfo "SSH key fingerprints:"
+  for file in /etc/ssh/ssh_host_*_key ; do
+    einfon
+    ssh-keygen -l -f $file
+  done | column -t
+  eend $?
+}
 # }}}
 
 # {{{ autostart of x11vnc
@@ -1473,6 +1489,7 @@ config_stats() {
  fi
 }
 # }}}
+
 # {{{ fix/workaround for unionfs
 fix_unionfs(){
   if [ -z "$INSTALLED" ]; then
@@ -1553,6 +1570,7 @@ DCSMP="/mnt/grml"
 GRMLCFG="$(getbootparam 'autoconfig' 2>>$DEBUG)"
 [ -n "$GRMLCFG" ] || GRMLCFG="GRMLCFG"
 if checkbootparam 'noautoconfig' || checkbootparam 'forensic' ; then
+  DCSDIR="/live/image" # set default so it works for "scripts" boot option as expected
   ewarn "Skipping running automount of device(s) labeled $GRMLCFG as requested." ; eend 0
 else
   if [ -z "$INSTALLED" ] ; then
@@ -1686,7 +1704,7 @@ if checkbootparam 'scripts' || [ "$DCSMP" = "/mnt/grmlcfg" ]; then
        sh -c $SCRIPTS
      elif [ -d "$SCRIPTS" ]; then
        einfo "Bootparameter scripts found. Trying to execute from directory ${SCRIPTS}:"
-       run-parts $SCRIPTS
+       run-parts --regex '.*' $SCRIPTS
      else
        einfo "Bootparameter scripts found. Trying to execute ${SCRIPTS}:"
        sh -c $SCRIPTS