[PC-BSD Commits] r5598 - pcbsd/trunk/pc-sysinstall/backend-query

svn at pcbsd.org svn at pcbsd.org
Mon Dec 14 11:23:43 PST 2009


Author: kris
Date: 2009-12-14 11:23:43 -0800 (Mon, 14 Dec 2009)
New Revision: 5598

Modified:
   pcbsd/trunk/pc-sysinstall/backend-query/send-logs.sh
Log:

Updated the send-logs script, so we can run interactive



Modified: pcbsd/trunk/pc-sysinstall/backend-query/send-logs.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend-query/send-logs.sh	2009-12-14 18:47:43 UTC (rev 5597)
+++ pcbsd/trunk/pc-sysinstall/backend-query/send-logs.sh	2009-12-14 19:23:43 UTC (rev 5598)
@@ -25,7 +25,6 @@
   cat /tmp/sys-install.cfg >> ${TMPLOG}
 fi
 
-
 # Save dmesg output
 echo "" >>${TMPLOG}
 echo "# DMESG OUTPUT " >>${TMPLOG}
@@ -45,15 +44,32 @@
 echo "# MOUNT OUTPUT " >>${TMPLOG}
 mount >> ${TMPLOG}
 
+echo "Log file saved to ${TMPLOG}"
+echo "Warning: This file will be lost once the system is rebooted."
+
+# Check if we need to mail the log somewhere
 if [ ! -z "$MAILTO" ]
 then
-  # Bring up all NICS under DHCP
-  enable_auto_dhcp
-  cat ${TMPLOG} | mail -s "Error report from pc-sysinstall" ${MAILTO}
-  MAILRESULT="$?"
+  if [ "${MAILTO}" = "interactive" ]
+  then
+    echo "Do you wish to e-mail a copy of this logfile? (Y/N)"
+    read tmp
+    if [ "$tmp" = "Y" -o "$tmp" = "y" ]
+    then
+      echo "Please enter the e-mail address:"
+      read MAILTO
+      # Bring up all NICS under DHCP
+      echo "Enabling DHCP on all NICs"
+      enable_auto_dhcp
+      echo "Sending a copy of log to ${MAILTO}"
+      cat ${TMPLOG} | mail -s "Error report from pc-sysinstall" ${MAILTO}
+    fi
+
+    echo "Press ENTER to exit"
+    read tmp
+  else
+    # Bring up all NICS under DHCP
+    enable_auto_dhcp
+    cat ${TMPLOG} | mail -s "Error report from pc-sysinstall" ${MAILTO}
+  fi
 fi
-
-# Compress the logfile
-gzip ${TMPLOG}
-
-exit $MAILRESULT



More information about the Commits mailing list