Last active
          August 29, 2015 14:11 
        
      - 
      
 - 
        
Save free5ty1e/300adb0800ba45f3fe4e to your computer and use it in GitHub Desktop.  
Revisions
- 
        
free5ty1e revised this gist
Dec 13, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,7 +38,7 @@ while [ 1 -lt 2 ]; do #You will need sudo on the pi to cat this xrdp log sudo cat $logFileName #Uncomment the following line to search, for example, for "USER:" and display only those lines that contain it: #sudo cat $logFileName | grep USER: echo "$(date) <--- this is now"  - 
        
free5ty1e created this gist
Dec 13, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ #!/bin/bash # xrdpLogMonitor.sh <optional timeout in seconds> # This script will check and spit out your xrdp log file every X seconds # (default 30 if not specified) # If the file size has changed since your last check, your terminal will beep (system alert) logFileName="/var/log/xrdp.log" if [ $# -eq 0 ]; then echo "No arguments supplied, will use default time between log polls (30 seconds)" secondsBetweenLogPolls=30 else echo "Using supplied timeout of $1 seconds between log polls" secondsBetweenLogPolls=$1 fi function updateLogModifiedTimeAndBeepIfChanged() { lastLogModifiedTime=$LogModifiedTime LogModifiedTime="$(stat --printf="%Z" $logFileName)" if [ "$LogModifiedTime" != "$lastLogModifiedTime" ]; then echo NEW LOG ACTIVITY CAPTURED!!!! #Below line creates the terminal beep echo -ne '\a' fi } while [ 1 -lt 2 ]; do updateLogModifiedTimeAndBeepIfChanged echo "$(ls -l $logFileName)" echo "Polling logfile $logFileName which was last modified at $LogModifiedTime..." #You will need sudo on the pi to cat this xrdp log sudo cat $logFileName #Uncomment the following line to search, for example, for “USER:” and display only those lines that contain it: #sudo cat $logFileName | grep USER: echo "$(date) <--- this is now" sleep $secondsBetweenLogPolls done