summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2006-07-19 11:16:26 +0000
committerRoy Marples <uberlord@gentoo.org>2006-07-19 11:16:26 +0000
commit26edaa5f1a52fb1b882d8e2adccb5221a0f636f0 (patch)
tree9fbce72e128cdac202ba13c3323d4df016d049de /app-laptop/laptop-mode-tools/files
parentAdd sys-libs/db-4 dependency, required by session helper (#140993). (diff)
downloadgentoo-2-26edaa5f1a52fb1b882d8e2adccb5221a0f636f0.tar.gz
gentoo-2-26edaa5f1a52fb1b882d8e2adccb5221a0f636f0.tar.bz2
gentoo-2-26edaa5f1a52fb1b882d8e2adccb5221a0f636f0.zip
Fix some potential quoting issues. Init script now checks if we are started before allowing a reload.
(Portage version: 2.1.1_pre3-r1)
Diffstat (limited to 'app-laptop/laptop-mode-tools/files')
-rw-r--r--app-laptop/laptop-mode-tools/files/digest-laptop-mode-tools-1.312
-rw-r--r--app-laptop/laptop-mode-tools/files/laptop_mode.init42
2 files changed, 44 insertions, 0 deletions
diff --git a/app-laptop/laptop-mode-tools/files/digest-laptop-mode-tools-1.31 b/app-laptop/laptop-mode-tools/files/digest-laptop-mode-tools-1.31
index f041c68ad7fa..1ba9b9650669 100644
--- a/app-laptop/laptop-mode-tools/files/digest-laptop-mode-tools-1.31
+++ b/app-laptop/laptop-mode-tools/files/digest-laptop-mode-tools-1.31
@@ -1 +1,3 @@
MD5 a332179ae046292b232234eb444b2122 laptop-mode-tools_1.31.tar.gz 86554
+RMD160 042b15337a365c6efd1d60ea74c4412fed7949df laptop-mode-tools_1.31.tar.gz 86554
+SHA256 cc2475a237c6d1b95667d464ebece1fbf5a518262fc9a74363ef820ba168d29e laptop-mode-tools_1.31.tar.gz 86554
diff --git a/app-laptop/laptop-mode-tools/files/laptop_mode.init b/app-laptop/laptop-mode-tools/files/laptop_mode.init
new file mode 100644
index 000000000000..d02cdcc2e3af
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/laptop_mode.init
@@ -0,0 +1,42 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/laptop-mode-tools/files/laptop_mode.init,v 1.1 2006/07/19 11:16:26 uberlord Exp $
+
+opts="${opts} reload"
+
+checkconfig() {
+ if [[ ! -f /proc/sys/vm/laptop_mode ]] ; then
+ eerror "Kernel does not support laptop_mode"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting laptop_mode"
+ touch /var/run/laptop-mode-enabled
+ /usr/sbin/laptop_mode auto init >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping laptop_mode"
+ rm -f /var/run/laptop-mode-enabled
+ /usr/sbin/laptop_mode stop init >/dev/null
+ eend $?
+}
+
+reload() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} has not yet been started"
+ return 1
+ fi
+
+ ebegin "Reloading laptop_mode"
+ /usr/sbin/laptop_mode auto init force >/dev/null
+ eend $?
+}
+
+# vim: set ts=4 :