fixes in the shell scripts

This commit is contained in:
Daniel Pavel 2012-12-14 19:20:15 +02:00
parent 8fbe77afb2
commit 187c0d2a52
5 changed files with 19 additions and 20 deletions

View File

@ -1,8 +1,9 @@
#!/bin/sh #!/bin/sh
Z=`readlink -f "$0"` Z=`dirname "$0"`
LIB=`readlink -f $(dirname "$Z")/../lib` Z=`readlink -f "$Z/.."`
export PYTHONPATH=$LIB
export PYTHONPATH="$Z/lib"
export PYTHONUNBUFFERED=yes export PYTHONUNBUFFERED=yes
NICE=`which nice 2>/dev/null` NICE=`which nice 2>/dev/null`

View File

@ -14,10 +14,10 @@ for x in $z; do
for y in $z; do for y in $z; do
echo "10 0${1} 81${x}${y} 000000" echo "10 0${1} 81${x}${y} 000000"
done done
done | $HC --hidpp | grep -v ' 8F.. ..0[12]' | grep -B 1 '^>> ' done | "$HC" --hidpp | grep -v ' 8F.. ..0[12]' | grep -B 1 '^>> '
for x in $z; do for x in $z; do
for y in $z; do for y in $z; do
echo "10 0${1} 83${x}${y} 000000" echo "10 0${1} 83${x}${y} 000000"
done done
done | $HC --hidpp | grep -v ' 8F.. ..0[12]' | grep -B 1 '^>> ' done | "$HC" --hidpp | grep -v ' 8F.. ..0[12]' | grep -B 1 '^>> '

View File

@ -1,12 +1,10 @@
#!/bin/sh #!/bin/sh
Z=`readlink -f "$0"` Z=`dirname "$0"`
APP=`readlink -f $(dirname "$Z")/../app` Z=`readlink -f "$Z/.."`
LIB=`readlink -f $(dirname "$Z")/../lib`
SHARE=`readlink -f $(dirname "$Z")/../share`
export PYTHONPATH=$APP:$LIB export PYTHONPATH="$Z/app:$Z/lib"
export XDG_DATA_DIRS=${SHARE}_override:$SHARE:$XDG_DATA_DIRS export XDG_DATA_DIRS="$Z/share_override:$Z/share:$XDG_DATA_DIRS"
NICE=`which nice 2>/dev/null` NICE=`which nice 2>/dev/null`
PYTHON=${PYTHON:-`which python python2 python3 | head -n 1`} PYTHON=${PYTHON:-`which python python2 python3 | head -n 1`}

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
Z=`readlink -f "$0"` Z=`dirname "$0"`
APP=`readlink -f $(dirname "$Z")/../app` Z=`readlink -f "$Z/.."`
LIB=`readlink -f $(dirname "$Z")/../lib`
export PYTHONPATH=$APP:$LIB export PYTHONPATH="$Z/app:$Z/lib"
NICE=`which nice 2>/dev/null` NICE=`which nice 2>/dev/null`
PYTHON=${PYTHON:-`which python python2 python3 | head -n 1`} PYTHON=${PYTHON:-`which python python2 python3 | head -n 1`}

View File

@ -2,7 +2,7 @@
set -e set -e
Z=$(readlink -f "$0") Z=`readlink -f "$0"`
RULES_D=/etc/udev/rules.d RULES_D=/etc/udev/rules.d
if ! test -d "$RULES_D"; then if ! test -d "$RULES_D"; then
@ -13,20 +13,20 @@ fi
RULE=99-logitech-unifying-receiver.rules RULE=99-logitech-unifying-receiver.rules
if test -n "$1"; then if test -n "$1"; then
SOURCE=$1 SOURCE="$1"
else else
SOURCE=$(dirname "$Z")/$RULE SOURCE="`dirname "$Z"`/$RULE"
if ! id -G -n | grep -q -F plugdev; then if ! id -G -n | grep -q -F plugdev; then
GROUP=$(id -g -n) GROUP=$(id -g -n)
echo "User '$USER' does not belong to the 'plugdev' group, will use group '$GROUP' in the udev rule." echo "User '$USER' does not belong to the 'plugdev' group, will use group '$GROUP' in the udev rule."
TEMP_RULE=${TMPDIR:-/tmp}/$$-$RULE TEMP_RULE="${TMPDIR:-/tmp}/$$-$RULE"
cp -f "$SOURCE" "$TEMP_RULE" cp -f "$SOURCE" "$TEMP_RULE"
SOURCE=$TEMP_RULE SOURCE=$TEMP_RULE
sed -i -e "s/GROUP=\"plugdev\"/GROUP=\"$GROUP\"/" "$SOURCE" sed -i -e "s/GROUP=\"plugdev\"/GROUP=\"$GROUP\"/" "$SOURCE"
fi fi
fi fi
if test "$(id -u)" != "0"; then if test "`id -u`" != "0"; then
echo "Switching to root to install the udev rule." echo "Switching to root to install the udev rule."
test -x /usr/bin/pkexec && exec /usr/bin/pkexec "$Z" "$SOURCE" test -x /usr/bin/pkexec && exec /usr/bin/pkexec "$Z" "$SOURCE"
test -x /usr/bin/sudo && exec /usr/bin/sudo -- "$Z" "$SOURCE" test -x /usr/bin/sudo && exec /usr/bin/sudo -- "$Z" "$SOURCE"