From 7ce08866713cffaee2fb6d21cc95c3af0c0062bc Mon Sep 17 00:00:00 2001 From: Sylvain Fourmanoit Date: Mon, 11 Aug 2008 15:55:30 -0400 Subject: [PATCH] Remove bashisms in the frontend Thanks to Raphael Geissert (found via Debian Bug #489535) for the fixes: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489535 --- utils/adesklets_frontend.sh.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/adesklets_frontend.sh.in b/utils/adesklets_frontend.sh.in index 79e7102..8ac3683 100644 --- a/utils/adesklets_frontend.sh.in +++ b/utils/adesklets_frontend.sh.in @@ -68,7 +68,7 @@ # Lock/unlock function # Based on the fact that creating a directory is atomic # -LOCKFILE=@LOCKFILES_DIR@/adesklets_frontend_$UID.lock +LOCKFILE=@LOCKFILES_DIR@/adesklets_frontend_$(id -ru).lock lock() { while : ; do @@ -85,12 +85,12 @@ unlock() { # Kill all desklets function # kill_desklets() { - LOCK=`ls @LOCKFILES_DIR@/adesklets_uid$UID_*.lock 2> /dev/null` + LOCK=`ls @LOCKFILES_DIR@/adesklets_uid$(id -ru)_*.lock 2> /dev/null` test "x$LOCK" = "x" || { PIDS=`cat $LOCK` kill $PIDS > /dev/null 2> /dev/null sleep 1 - kill -9 $PIDS > /dev/null 2> /dev/null + kill -s KILL $PIDS > /dev/null 2> /dev/null } } @@ -98,7 +98,8 @@ kill_desklets() { # Detect potential fake root windows function # roots() { - local GEOM=`xwininfo -root | sed -n '/geometry/{s/^.*geometry[ \t]*//;p}'` + local GEOM + GEOM=`xwininfo -root | sed -n '/geometry/{s/^.*geometry[ \t]*//;p}'` local ID if test $# -eq 0 ; then ID="-root" @@ -215,7 +216,7 @@ while test $# -gt 0 ; do -w) test $# -gt 1 || usage "no progname given after -w switch." while : ; do - test -z "`ps -u $UID -U $UID -o comm | sed -n "/$2/p"`" || break + test -z "`ps -u $(id -ru) -U $(id -ru) -o comm | sed -n "/$2/p"`" || break sleep 10 done shift -- 2.11.4.GIT