summaryrefslogtreecommitdiff
path: root/ACE/bin/clean_sems.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/bin/clean_sems.sh')
-rwxr-xr-xACE/bin/clean_sems.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/ACE/bin/clean_sems.sh b/ACE/bin/clean_sems.sh
new file mode 100755
index 00000000000..57fbf3e9c06
--- /dev/null
+++ b/ACE/bin/clean_sems.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+if [ -z "$USER" ]; then
+ USER=`id | sed 's/).*//; s/.*(//'`
+fi
+
+SYSTEM=`uname -s`
+case "$SYSTEM" in
+ "Linux" )
+ ipcs -a | grep $USER | awk '{ print ($2) }' | xargs ipcrm sem;
+ ;;
+ * )
+ semids=`ipcs | grep "^s" | grep $USER | awk '{ print ($2) }'`
+ for p in $semids
+ do ipcrm -s $p
+ done
+ ;;
+esac