Skip to content
Permalink
Browse files

Ruby version of delipc

  • Loading branch information...
kaazoo committed Jun 13, 2010
1 parent e493af3 commit 68a57ee4f4ddc76c73eb32b77bd2372370b45ffd
Showing with 16 additions and 0 deletions.
  1. +16 −0 delipc.rb
@@ -0,0 +1,16 @@

puts "Deleting all SHM segments and semaphores of current user."

ipcs=`ipcs -m | awk '{print $2}'`.split("\n").each do |shm_id|
shm_id = shm_id.to_i
if shm_id > 0
`ipcrm -m #{shm_id}`
end
end

ipcs=`ipcs -s | awk '{print $2}'`.split("\n").each do |sem_id|
sem_id = sem_id.to_i
if sem_id > 0
`ipcrm -s #{sem_id}`
end
end

0 comments on commit 68a57ee

Please sign in to comment.
You can’t perform that action at this time.