aboutsummarylogtreecommitdiffstats
path: root/mk-udev-rules
blob: bfc10c951095531c778b6892702839795857ba56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/gawk -f

BEGIN {
  FS = ",";
  print "ACTION==\"add\", ATTR{idVendor}==\"04f9\", GOTO=\"brscan5\"";
  print "GOTO=\"brscan5_end\"";
  print "LABEL=\"brscan5\"";
}
NF >= 3 && $1 ~ /^ *0[xX][[:xdigit:]]+ *$/ {
  id = "000" tolower( substr( $1, 3 ));
  id = substr( id, length( id ) - 3 );
  print "ATTR{idProduct}==\"" id "\", MODE=\"0664\", GROUP=\"lp\", ENV{libsane_matched}=\"yes\"";
}
END {
  print "ATTR{idProduct}==\"0468\", MODE=\"0664\", GROUP=\"lp\", ENV{libsane_matched}=\"yes\"";
  print "LABEL=\"brscan5_end\"";
}