Tobiahao

CLEAR_IPCS_SCRIPT

Dec 19th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ME=`whoami`
  4.  
  5. IPCS_S=`ipcs -s | egrep "0x[0-9a-f]+ [0-9]+" | grep $ME | cut -f2 -d" "`
  6. IPCS_M=`ipcs -m | egrep "0x[0-9a-f]+ [0-9]+" | grep $ME | cut -f2 -d" "`
  7. IPCS_Q=`ipcs -q | egrep "0x[0-9a-f]+ [0-9]+" | grep $ME | cut -f2 -d" "`
  8.  
  9.  
  10. for id in $IPCS_M; do
  11.     ipcrm -m $id;
  12. done
  13.  
  14. for id in $IPCS_S; do
  15.     ipcrm -s $id;
  16. done
  17.  
  18. for id in $IPCS_Q; do
  19.     ipcrm -q $id;
  20. done
Advertisement
Add Comment
Please, Sign In to add comment