My problem is I am not able to run script automaticlly when modem is connected.
I need a code to be run when my modem is detected. I am having a photon modem and I am using sakis3g script to connect to internet. I have to run sudo sakis3g connect in terminal to connect my modem. I have made this code to run without password by editing sudoers list. After that I can connect modem by just typing sudo sakis3g connect in terminal.
I was reading this post about run a script automatically when usb is mounted and was following steps.
my lsusb output is like
modem is ZTE WCDMA Technologies MSM
I noted down ID "19d2:1254"
ran command sudoedit /etc/udev/rules.d/mount-modem.rules
edited rules to
ACTION=="add", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1254", RUN+="/home/bibi/bin/modem.sh"
my modem.sh is
I am able to run modem.sh from terminal and connect modem.
But when usb modem is removed and connected script is not running. I dont know whether I missed anything.
Thanks
Edit. It is working.... No changes were made. Problem was delay was a little more that made me think not working. Thank you