summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinit.d/gpm-pre10
1 files changed, 6 insertions, 4 deletions
diff --git a/init.d/gpm-pre b/init.d/gpm-pre
index f44e5c2..ef97e38 100755
--- a/init.d/gpm-pre
+++ b/init.d/gpm-pre
@@ -9,10 +9,12 @@ depend() {
}
start() {
- # FIXME: If MOUSE_DEVICE is empty, we actually do not want to do anything, not even start gpm.
- # created by hwsetup
- source /etc/sysconfig/gentoo
- source /etc/sysconfig/mouse
+ [ -f /etc/sysconfig/gentoo ] && source /etc/sysconfig/gentoo
+ [ -f /etc/sysconfig/mouse ] && source /etc/sysconfig/mouse
+ if [ -z "${MOUSE_DEVICE}" ]; then
+ ewarn "No mouse detected. GPM will not be started."
+ return 0
+ fi
einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..."
if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ]; then