Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Copy logs and diagnostic info to USB storage automatically on device insert
This is a simple mod to usbmount rules to gather debug information for cases where you can't SSH into the box.
When device can't connect to a network it can be difficult to troubleshoot issue as you can't retrieve logs from the system. This simple patch is designed to leverage a usb flash drive and the usbmount process to run diagnostics under certain conditions when a usb flash drive is plugged it and output the results to the flash drive.
After this patch, take a usb flash drive and create a directory on it called getlogs in the root directory:
mkdr /getlogs
Then plug the usb drive into system and if the getlogs directory exists the diag.sh script will run and put its contents in /getlogs/diag.txt and the script will also copy the xbmc log files to the getlogs directory as well.
The modification also looks for a shell script in /getlogs/runme.sh
Which allows additional commands to be run after USB device is inserted. The mountpoint directory is passed as an argument to the runme.sh scripts as first argument.
Can be used for things like updating firmware or gathering additional diagnostic information.