Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
17.7 Legacy Series
»
[SOLVED] How can run script when usb is plugged in freebsd?
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] How can run script when usb is plugged in freebsd? (Read 4608 times)
jalalahmadi
Newbie
Posts: 15
Karma: 2
[SOLVED] How can run script when usb is plugged in freebsd?
«
on:
September 21, 2017, 08:48:23 am »
Hi
I want run script USB is plugged.
/etc/rc.d/lte.sh
«
Last Edit: September 23, 2017, 09:00:18 am by franco
»
Logged
bartjsmit
Hero Member
Posts: 2016
Karma: 194
Re: How can run script when usb is plugged in freebsd?
«
Reply #1 on:
September 21, 2017, 04:59:29 pm »
Have a look at this
https://www.freebsd.org/cgi/man.cgi?devd.conf
Bart...
Logged
franco
Administrator
Hero Member
Posts: 17660
Karma: 1611
Re: How can run script when usb is plugged in freebsd?
«
Reply #2 on:
September 22, 2017, 12:33:35 am »
devd uses plugin directories which we use as well, e.g.
https://github.com/opnsense/core/blob/master/src/etc/devd/ifnet.conf
So you want to find out which even you want to look for and create your own file, e.g. /usr/local/etc/devd/lte.conf
Cheers,
Franco
Logged
jalalahmadi
Newbie
Posts: 15
Karma: 2
Re: How can run script when usb is plugged in freebsd?
«
Reply #3 on:
September 23, 2017, 08:59:18 am »
Thanks for your advice
Works great
Code:
[Select]
notify 100 {
match "ugen" "ugen0.3";
action "/etc/rc.d/lte.sh";
};
Logged
franco
Administrator
Hero Member
Posts: 17660
Karma: 1611
Re: How can run script when usb is plugged in freebsd?
«
Reply #4 on:
September 23, 2017, 09:00:07 am »
Great stuff, thanks for sharing the answer with us.
Cheers,
Franco
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
17.7 Legacy Series
»
[SOLVED] How can run script when usb is plugged in freebsd?