answered
2015-01-30 15:03:12 +0200
Following rule works for me:
$ cat /etc/udev/rules.d/98-jolla.rules
SUBSYSTEM=="net", ACTION=="add", ENV{ID_MODEL}=="Sailfish", ENV{ID_SERIAL_SHORT}=="PUT_YOUR_ID_HERE", RUN+="/usr/bin/ifconfig $env{INTERFACE} 192.168.2.13"
You have to remove ID_SERIAL_SHORT checking part or put there ID of your device. You can check ID of your device by running sudo udevadm monitor --environment --udev and [un]plugging your device.
Note that filename of rules file have to end with .rules
You probably need to reload udev daemon config. Under Arch linux I've run
sudo systemctl restart systemd-udevd
just in case.
Isn't at this point (net/add) device already renamed?
koudi ( 2014-01-10 20:21:56 +0200 )edit@evk Try and replace
SebM ( 2019-10-29 02:52:28 +0200 )editATTRS{ID_VENDOR_ID}==....
byENV{ID_VENDOR_ID}==....