summaryrefslogtreecommitdiff
path: root/system/gpsd/gpsd.hotplug.wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'system/gpsd/gpsd.hotplug.wrapper')
-rw-r--r--system/gpsd/gpsd.hotplug.wrapper41
1 files changed, 41 insertions, 0 deletions
diff --git a/system/gpsd/gpsd.hotplug.wrapper b/system/gpsd/gpsd.hotplug.wrapper
new file mode 100644
index 0000000000..429db379ce
--- /dev/null
+++ b/system/gpsd/gpsd.hotplug.wrapper
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# This file is Copyright (c) 2010 by the GPSD project
+# BSD terms apply: see the file COPYING in the distribution root for details.
+# [Modified to add Slackware-friendly conf file]
+
+PATH=/usr/sbin:$PATH
+export PATH
+
+if [ -r /etc/default/gpsd ]; then
+ . /etc/default/gpsd
+elif [ -r /etc/sysconfig/gpsd ]; then
+ . /etc/sysconfig/gpsd
+ GPSD_OPTIONS=$OPTIONS
+ GPSD_SOCKET=$CONTROL_SOCKET
+elif [ -r /etc/rc.d/rc.gpsd.conf ]; then
+ . /etc/rc.d/rc.gpsd.conf
+fi
+
+if [ -n "$GPSD_OPTIONS" ]; then
+ export GPSD_OPTIONS
+fi
+if [ -n "$GPSD_SOCKET" ]; then
+ export GPSD_SOCKET
+fi
+
+if [ -n "$USBAUTO" ]; then
+ [ "$USBAUTO" = "true" ] || exit 0
+fi
+
+if [ "$ACTION" = "remove" ] ; then
+ if echo $DEVLINKS | grep -q /dev/gps; then
+ exec /lib/udev/gpsd.hotplug "$ACTION" "$DEVNAME"
+ fi
+ exit 0
+fi
+
+if [ -x /usr/bin/python ]; then
+ exec /lib/udev/gpsd.hotplug "$ACTION" "$DEVNAME"
+fi
+