Date: Fri, 9 Oct 2020 14:13:08 -0600 From: Warner Losh <imp@bsdimp.com> To: Renato Botelho <garga@freebsd.org> Cc: Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r366578 - head/sbin/devd Message-ID: <CANCZdfrgJh90%2BRZgL7N0nZw1Cf72QEsoDpHjdbGOcdMr8aoBTg@mail.gmail.com> In-Reply-To: <CANCZdfqgtVddzPmH9q7oof8deWq%2BJry=q22Kk3AMz-APJ--q1g@mail.gmail.com> References: <202010091529.099FT6Ab049635@repo.freebsd.org> <af6500af-0a96-1200-0c6e-34df212fcd7e@FreeBSD.org> <CANCZdfq9cvbaRoAc8Cd7czrF2ur8GKNSeCqchCe5=iBtRL1Fow@mail.gmail.com> <2f49af1f-f0fb-f5f0-82bf-8b46ead027c1@FreeBSD.org> <563930e3-19ec-44dd-fd6f-1d55859d9235@FreeBSD.org> <CANCZdfqgtVddzPmH9q7oof8deWq%2BJry=q22Kk3AMz-APJ--q1g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 9, 2020 at 12:47 PM Warner Losh <imp@bsdimp.com> wrote: > > > On Fri, Oct 9, 2020, 12:20 PM Renato Botelho <garga@freebsd.org> wrote: > >> On 09/10/20 15:16, Renato Botelho wrote: >> > On 09/10/20 13:57, Warner Losh wrote: >> >> >> >> >> >> On Fri, Oct 9, 2020 at 10:19 AM Renato Botelho <garga@freebsd.org >> >> <mailto:garga@freebsd.org>> wrote: >> >> >> >> On 09/10/20 12:29, Warner Losh wrote: >> >> > Author: imp >> >> > Date: Fri Oct 9 15:29:05 2020 >> >> > New Revision: 366578 >> >> > URL: https://svnweb.freebsd.org/changeset/base/366578 >> >> <https://svnweb.freebsd.org/changeset/base/366578> >> >> > >> >> > Log: >> >> > Avoid using single quotes in arguments to logger. >> >> > >> >> > Single quotes interfere with the workaround put in with >> >> r335753 and >> >> > aren't necessary in this case. I believe that all the >> >> underling issues >> >> > with r335753 have been corrected, but need to do more >> extensive >> >> > followup before reverting it as a bad idea. >> >> >> >> Hi Warner, >> >> >> >> How to proceed if it's needed to pass multiple parameters to a >> >> command >> >> in following format? >> >> >> >> cmd param1 'param2 has spaces and a $variable' >> >> >> >> >> >> action "cmd param1 'param2 has spaces and a '$variable"; >> >> >> >> should do the trick. I'm documenting this now... >> > >> > It worked!! Thanks! >> >> Oooops, too fast. >> >> I wrote this script: >> >> #!/bin/sh >> >> echo "Param1 = '${1}'" >> /root/log >> echo "Param2 = '${2}'" >> /root/log >> >> And added this action on devd config: >> >> notify 0 { >> match "system" "IFNET"; >> match "type" "LINK_UP"; >> media-type "ethernet"; >> action "/root/log.sh -c 'interface linkup start '$subsystem"; >> }; >> >> notify 0 { >> match "system" "IFNET"; >> match "type" "LINK_DOWN"; >> media-type "ethernet"; >> action "/root/log.sh -c 'interface linkup stop '$subsystem"; >> }; >> >> And got the following output on /root/log: >> >> Param1 = '-c' >> Param2 = 'interface linkup start $em0' >> > > Doh. I'll dig deeper. > It works for me. Did you remember to kill -HUP devd? Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrgJh90%2BRZgL7N0nZw1Cf72QEsoDpHjdbGOcdMr8aoBTg>