Skip to content

Commit

Permalink
in hotplug.d/tty we already know it is a TTY device, so we do not nee…
Browse files Browse the repository at this point in the history
…d this check anymore
  • Loading branch information
maurerle committed Aug 29, 2024
1 parent b7ba830 commit 03b0bba
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
#!/bin/sh
TTYPATH="/sys${DEVPATH}/tty"
lockpath="/var/lock/hotplug-update-location-gps_${DEVNAME}.lock"

if [ "${ACTION}" = "add" ]; then
enabled=$(uci get update-location-gps.settings.enabled)
[ "${enabled}" != "1" ] && exit 0
test -e "${lockpath}" && exit 0
if test -e "${TTYPATH}"; then
echo "hotplug-update-location-gps: TTY device ${DEVNAME} was plugged in" > /dev/kmsg
echo "${DEVPATH}" > "${lockpath}"
echo "*/5 * * * * /usr/bin/update-location-gps /dev/${DEVNAME} | logger -t update-location-gps" > "/usr/lib/micron.d/update-location-gps_${DEVNAME}"
/etc/init.d/micrond restart
fi
echo "hotplug-update-location-gps: TTY device ${DEVNAME} was plugged in" > /dev/kmsg
echo "${DEVPATH}" > "${lockpath}"
echo "*/5 * * * * /usr/bin/update-location-gps /dev/${DEVNAME} | logger -t update-location-gps" > "/usr/lib/micron.d/update-location-gps_${DEVNAME}"
/etc/init.d/micrond restart
fi

if [ "${ACTION}" = "remove" ]; then
Expand Down

0 comments on commit 03b0bba

Please sign in to comment.