gparted/gparted.in
Curtis Gedak c1a51f1402 Fixed typo of "freedeskdesktop" in hal-lock name.
svn path=/trunk/; revision=1063
2009-02-11 22:08:30 +00:00

37 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
#
# Purpose: Perform appropriate startup of GParted executable gpartedbin.
#
# On systems with hal-lock, use hal-lock to acquire device
# locks prior to running gpartedbin.
# This is to prevent devices from being automounted.
# File system problems can occur if devices are mounted
# prior to the completion of GParted's operations.
# See GParted bug #324220
# http://bugzilla.gnome.org/show_bug.cgi?id=324220
#
# On systems without hal-lock, invoke gpartedbin directly.
#
#
# Search PATH to determine if hal-lock program can be found
#
HAVE_HAL_LOCK=no
for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
if test -x "$k/hal-lock"; then
if test "z`ps -e | grep hald`" != "z"; then
HAVE_HAL_LOCK=yes
break
fi
fi
done
#
# Use hal-lock for invocation if it exists, otherwise simply run gpartedbin
#
if test "x$HAVE_HAL_LOCK" = "xyes"; then
hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \
--run "@installdir@/gpartedbin $*"
else
@installdir@/gpartedbin $*
fi