#!/bin/sh ## ## NAUTILUS ## SCRIPT: 00_anyfile_SHOW_KERNEL-BOOT_MSTS_dmesg.sh ## ## PURPOSE: Shows the kernel boot messages as displayed by the ## 'dmesg' command. ## ## METHOD: The 'dmesg' output is put in a temporary file and that file ## is shown in a text-viewer of the user's choice. ## ## HOW TO USE: In Nautilus, select ANY file in ANY directory. ## Then right-click and choose this script to run (name above). ## ########################################################################### ## Created: 2010may12 ## Changed: 2011may02 Added $USER to a temp filename. ## Changed: 2011may11 Get 'nautilus-scripts' directory via an include script. ## Changed: 2012may11 Changed script name in comments above and touched up ## the comments. Changed some indenting below. ####################################################################### ## FOR TESTING: (show statements as they execute) # set -x ################################################################### ## Prep a temporary filename, to hold the messages. ## We put the outlist file in /tmp, in case the user ## does not have write-permission in the current directory, ## and because the output of 'dmesg' does not, usually, ## have a direct relation to the current directory. ################################################################### OUTLIST="/tmp/${USER}_show_kernel_bootMsgs_dmesg.lis" if test -f "$OUTLIST" then rm -f "$OUTLIST" fi ############################### ## Make HEADER for the listing. ############################### THISHOST=`hostname` echo "\ ................ `date '+%Y %b %d %a %T%p %Z'` ...................... Kernel boot messages (via 'dmesg') --- on host: $THISHOST Some more information is at the bottom of this list. ------------------------------------------------------------------------------ " > "$OUTLIST" ##################################################### ## Use 'dmesg' to make the main part of the listing. ##################################################### echo " ##### dmesg : ##### " >> "$OUTLIST" dmesg >> "$OUTLIST" #################################### ## Make the TRAILER for the listing. #################################### SCRIPT_BASENAME=`basename $0` SCRIPT_DIRNAME=`dirname $0` echo " ................ `date '+%Y %b %d %a %T%p %Z'` ...................... The list above was generated by the script $SCRIPT_BASENAME in directory $SCRIPT_DIRNAME The list was created with the 'dmesg' command. If you want to change the output of this script, you can simply edit the script. ------------------------------------------------------------------------------ FOR MORE INFO ON OUTPUT OF 'dmesg': You can type 'man dmesg' in a terminal to see details on how the program can be used. ('man' stands for Manual. It gives you a user manual for a command/utility/protocol/topic.) You can type 'man man' at a shell prompt to see a description of the 'man' command. Or use the 'show_manhelp_4topic' Nautilus script in the 'LinuxHELPS' group of Nautilus scripts. Enter 'dmesg' at the prompt for a command/topic. --- This script is a debugging aid. Instead of copying the boot messages by hand (or using a command like 'dmesg > boot.messages'), the user can mail this boot messages file to whoever can debug their problem. ******* END OF LIST of the 'dmesg' output on host $THISHOST ******* " >> "$OUTLIST" ########################################### ## Show the listing. ########################################### ## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi . $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi . $DIR_NautilusScripts/.set_VIEWERvars.shi $TXTVIEWER "$OUTLIST"