gpsdctl@.service.in 440 B

123456789101112131415
  1. [Unit]
  2. Description=Manage %I for GPS daemon
  3. Requires=gpsd.socket
  4. BindsTo=dev-%i.device
  5. After=dev-%i.device
  6. [Service]
  7. Type=oneshot
  8. Environment="GPSD_SOCKET=@RUNDIR@/gpsd.sock"
  9. EnvironmentFile=-/etc/default/gpsd
  10. EnvironmentFile=-/etc/sysconfig/gpsd
  11. RemainAfterExit=yes
  12. ExecStart=/bin/sh -c "[ \"$USBAUTO\" = true ] && @SBINDIR@/gpsdctl add /dev/%I || :"
  13. ExecStop=/bin/sh -c "[ \"$USBAUTO\" = true ] && @SBINDIR@/gpsdctl remove /dev/%I || :"