gparted/gparted.in

36 lines
1.0 KiB
Plaintext
Raw Normal View History

#!/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
HAVE_HAL_LOCK=yes
break
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.freedeskdesktop.Hal.Device.Storage --exclusive \
--run "@installdir@/gpartedbin $*"
else
@installdir@/gpartedbin $*
fi