hal/tools hal-luks-remove.in, 1.2, 1.3 hal-luks-setup.in, 1.3,
1.4 hal-system-lcd-get-brightness, 1.2,
1.3 hal-system-lcd-set-brightness, 1.2,
1.3 hal-system-power-set-power-save, 1.3,
1.4 hal-system-power-suspend, 1.3, 1.4
Danny Kukawka
dkukawka at freedesktop.org
Tue Nov 29 09:47:56 PST 2005
Update of /cvs/hal/hal/tools
In directory gabe:/tmp/cvs-serv17713/tools
Modified Files:
hal-luks-remove.in hal-luks-setup.in
hal-system-lcd-get-brightness hal-system-lcd-set-brightness
hal-system-power-set-power-save hal-system-power-suspend
Log Message:
2005-11-29 Danny Kukawka <danny.kukawka at web.de>
* tools/hal-luks-remove.in, tools/hal-luks-setup.in,
tools/hal-system-lcd-get-brightness,
tools/hal-system-lcd-set-brightness,
tools/hal-system-power-set-power-save,
tools/hal-system-power-suspend: Added checks for needed
environment variables to prevent call them from commandline if a
variable is missing. Fixed error messages.
Index: hal-luks-remove.in
===================================================================
RCS file: /cvs/hal/hal/tools/hal-luks-remove.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hal-luks-remove.in 29 Jul 2005 20:32:58 -0000 1.2
+++ hal-luks-remove.in 29 Nov 2005 17:47:54 -0000 1.3
@@ -21,6 +21,13 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# Check for environment variables
+if [ "$HAL_PROP_BLOCK_DEVICE" == "" ] || [ "$HAL_PROP_INFO_UDI" == "" ] || [ "$HAL_PROP_VOLUME_UUID" == "" ] ; then
+ echo "Missing or empty environment variable(s)." >&2
+ echo "This script should be started by hald." >&2
+ exit 1
+fi
+
CRYPTSETUP=/sbin/cryptsetup
HAL_FIND_BY_PROPERTY=@BINDIR@/hal-find-by-property
Index: hal-luks-setup.in
===================================================================
RCS file: /cvs/hal/hal/tools/hal-luks-setup.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hal-luks-setup.in 29 Jul 2005 20:32:58 -0000 1.3
+++ hal-luks-setup.in 29 Nov 2005 17:47:54 -0000 1.4
@@ -21,6 +21,14 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# Check for environment variables
+if [ "$HAL_PROP_BLOCK_DEVICE" == "" ] || [ "$HAL_PROP_INFO_UDI" == "" ] ; then
+ echo "Missing or empty environment variable(s)." >&2
+ echo "This script should be started by hald." >&2
+ exit 1
+fi
+
+
read password
LUKSSETUP=@SBINDIR@/luks-setup
Index: hal-system-lcd-get-brightness
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-lcd-get-brightness,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hal-system-lcd-get-brightness 26 Sep 2005 17:11:10 -0000 1.2
+++ hal-system-lcd-get-brightness 29 Nov 2005 17:47:54 -0000 1.3
@@ -7,6 +7,13 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
+# Check for environment variables
+if [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "" ] || [ "$HAL_PROP_LINUX_ACPI_PATH" == "" ]; then
+ echo "Missing or empty environment variable(s)." >&2
+ echo "This script should be started by hald." >&2
+ exit 1
+fi
+
# Check for file existance and that it's readable
if [ ! -r $HAL_PROP_LINUX_ACPI_PATH ]; then
echo "org.freedesktop.Hal.Device.LaptopPanel.NotSupported" >&2
@@ -40,7 +47,7 @@
let "value = ${value} - 1"
else
echo "org.freedesktop.Hal.Device.LaptopPanel.NotSupported" >&2
- echo "No acpi method script found" >&2
+ echo "No ACPI method found" >&2
exit 1
fi
Index: hal-system-lcd-set-brightness
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-lcd-set-brightness,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hal-system-lcd-set-brightness 26 Sep 2005 17:11:10 -0000 1.2
+++ hal-system-lcd-set-brightness 29 Nov 2005 17:47:54 -0000 1.3
@@ -7,6 +7,16 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
+# Check for environment variables
+if [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "" ] ||
+ [ "$HAL_PROP_LINUX_ACPI_PATH" == "" ] ||
+ [ "$HAL_PROP_LAPTOP_PANEL_NUM_LEVELS" == "" ] ; then
+ echo "Missing or empty environment variable(s)." >&2
+ echo "This script should be started by hald." >&2
+ exit 1
+fi
+
+# read value for set brightness
read value
# Check for file existance and that it's writable
@@ -44,7 +54,7 @@
echo "$value" > $HAL_PROP_LINUX_ACPI_PATH
else
echo "org.freedesktop.Hal.Device.LaptopPanel.NotSupported" >&2
- echo "No acpi method script found" >&2
+ echo "No ACPI method found" >&2
exit 1
fi
Index: hal-system-power-set-power-save
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-power-set-power-save,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hal-system-power-set-power-save 28 Sep 2005 16:52:13 -0000 1.3
+++ hal-system-power-set-power-save 29 Nov 2005 17:47:54 -0000 1.4
@@ -3,7 +3,7 @@
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
- echo No powersave script found >&2
+ echo No powersave method found >&2
exit 1
}
Index: hal-system-power-suspend
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-power-suspend,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hal-system-power-suspend 28 Sep 2005 16:52:13 -0000 1.3
+++ hal-system-power-suspend 29 Nov 2005 17:47:54 -0000 1.4
@@ -8,7 +8,7 @@
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
- echo No suspend script found >&2
+ echo No suspend method found >&2
exit 1
}
More information about the hal-commit
mailing list