- // Make sure that there is no conflict
- snprintf(commandstring, STRING_SIZE, "/usr/bin/touch "UDEV_NET_CONF" >/dev/null 2>&1");
- system(commandstring);
-
-// snprintf(commandstring, STRING_SIZE, "/bin/cat "UDEV_NET_CONF" | /bin/grep -v \"%s\" > "UDEV_NET_CONF" 2>/dev/null", macaddr);
-// system(commandstring);
-
- snprintf(commandstring, STRING_SIZE, "/bin/cat "UDEV_NET_CONF" | /bin/grep -v \"%s0\" > "UDEV_NET_CONF" 2>/dev/null", lcolourcard[colour]);
- system(commandstring);
-
- if( (fp = fopen(UDEV_NET_CONF, "a")) == NULL )
- {
- fprintf(stderr,"Couldn't open" UDEV_NET_CONF);
- return 1;
- }
- fprintf(fp,"ACTION==\"add\", SUBSYSTEM==\"net\", SYSFS{address}==\"%s\", NAME=\"%s0\" # %s\n", nics[card].macaddr, lcolourcard[colour], nics[card].description);
- fclose(fp);
-