Last active
July 30, 2020 13:45
-
-
Save cyberbutler/d2d858624265d0c2d65c2bab2f835211 to your computer and use it in GitHub Desktop.
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 characters
RETRN_VAL=$?; | |
if [ -f /tmp/lastoutput.tmp ]; then | |
LAST_OUTPUT=$(cat /tmp/lastoutput.tmp); | |
rm /tmp/lastoutput.tmp; | |
fi; | |
logger -S 10000 -p local6.debug "{\ | |
\"user\": \"$(whoami)\", \ | |
\"path\": \"$(pwd)\", \ | |
\"pid\": \"$$\", \ | |
\"b64_command\": \"$(history 1 | sed -r "s/^\s*[0-9]+\s*//" | base64 -w0 )\", \ | |
\"status\": \"$RETRN_VAL\", \ | |
\"b64_output\": \"$LAST_OUTPUT\"}"; | |
unset LAST_OUTPUT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment