#!/bin/bash

## Xircom device 
#ATTRS{idVendor}=="115d", ATTRS{idProduct}=="0x45f", MODE="0660", GROUP="dialout"

egrep -o 'PCI_VENDOR_ID_(ATT|XIRCOM), ([0-9]?[a-f]?)x([0-9]?[a-f]?)+'  kmodule/martian_ids.c | awk 'BEGIN {print "##\n#Automagic udev rules file for modems MARS (aka, Martian Modem)\n"} { if ($1=="PCI_VENDOR_ID_ATT,") { Vendor="AT&T";id="11c1" } else { Vendor="Xircom";id="115d"} ; print "# "Vendor" device \nATTRS{idVendor}==\""id"\", ATTRS{idProduct}==\""$2"\", MODE=\"0660\", GROUP=\"dialout\""}'
