summaryrefslogtreecommitdiff
path: root/bin/clean_sems.sh
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-06-05 12:06:55 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-06-05 12:06:55 +0000
commit72e4399f1896ccba2c2af40c0f342dc9c9c53c70 (patch)
treeee6de7a373e450320d76566d28f2008920902846 /bin/clean_sems.sh
parent99ced50c3f9c65a0e51232f9d293d4bf0f72bef9 (diff)
downloadATCD-72e4399f1896ccba2c2af40c0f342dc9c9c53c70.tar.gz
ChangeLogTag: Thu Jun 5 07:05:42 2003 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'bin/clean_sems.sh')
-rwxr-xr-xbin/clean_sems.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/bin/clean_sems.sh b/bin/clean_sems.sh
index a20f520bc54..57fbf3e9c06 100755
--- a/bin/clean_sems.sh
+++ b/bin/clean_sems.sh
@@ -1,12 +1,18 @@
#!/bin/sh
-if test "$OSTYPE" = "solaris"; then
- semids=`ipcs | grep $USER | awk '{ print ($2) }'`
- for p in $semids
- do ipcrm -s $p
- done
-else
- # Linux/GNU
- ipcs -a | grep $USER | awk '{ print ($2) }' | xargs ipcrm sem;
+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