#!/bin/bash
# Copyright (C) 2016 Velocloud Inc
# Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es>

# Load hotplug common utilities
. /etc/modemmanager/modemmanager.common

# Always make sure the rundir exists
/bin/mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"

# We require a device name
[ -n "$DEVNAME" ] || return

# Report TTY
if echo $DEVNAME | grep -Eq 'ttyACM*' ;
then
	echo $DEVNAME
	mm_log "${ACTION} serial interface ${DEVNAME}: event processed"
	mm_report_event "${ACTION}" "${DEVNAME}" "tty" "/sys${DEVPATH}"
fi
