Advertisement
danielhilst

whowakesmeup.sh

Jan 16th, 2014
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.68 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # Instructions: I use this to figure out who is calling someone
  4. #               I move the script/executable that I want to discovery
  5. #               the caller and put this on its place, the I edit last
  6. #               line of this to call the same (moved) binary with all
  7. #               arguments. Every thing should work (with a little overhead)
  8. #               and you should got the command calling your misterious
  9. #               on whowakesmeup.log, just edit the path if you wish
  10.  
  11. LOG=~/whowakesmeup.log
  12. PPID=$(ps -o 'ppid=' --pid $$ | tr -d ' ')
  13. echo "I'm being executed by" >> $LOG
  14. ps www --pid $PPID >> $LOG
  15. echo '--' >> $LOG
  16.  
  17. # Change here
  18. # /path/for/your_command $*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement