Menu

parameter for shell-cmd action

Help
JensH
2011-03-11
2012-12-14
  • JensH

    JensH - 2011-03-11

    Hi Jean-François,
    would it be possible to implement parameters for the action "shell-cmd"?
    For example:

    <action type="shell-cmd" cmd="/opt/linknx/scripts/script1.sh"  param-text="something"/>
    <action type="shell-cmd" cmd="/opt/linknx/scripts/script2.sh"  param-object="some_linknx_object"/>
    

    The first type would just handover "something" to the shell as %1.
    The second version could handover the name of the object (i.e. "some_linknx_object" ) as %1 and the VALUE of the object as %2.

    Is this feasible/ reasonable?
    Thanks, best Regards, Jens

    PS.: thanks for releasing the 1.28 - will compile & test ASAP.

     
  • jef2000

    jef2000 - 2011-03-12

    Hi,

    It seems you are lucky because that's something I added in 0.0.1.28.

    <action type="shell-cmd" cmd="/opt/linknx/scripts/script1.sh something" />
     <action type="shell-cmd" cmd="/opt/linknx/scripts/script2.sh ${some_linknx_object}" var="true" />
    

    The same kind of things is supported in email or sms. Add parameter var="true" and use ${object_id} to insert object value.

    Regards

    Jean-François

     
  • JensH

    JensH - 2011-03-12

    Hi Jean-François
    cool!
    I was asking, because I had the netsrac-question (blind control…reset to previous value) in mind. But since you have done it also for mail  - I will use it as well.
    I mainly send mails to me for testing purposes, before I bring a function "into production" - and my family complains…:-)

    Any other hidden features, other eastereggs?? ;-)

    Thanks again, best Regards, Jens

     
  • jef2000

    jef2000 - 2011-03-13

    > Any other hidden features, other eastereggs?? ;-)
    Do you think you could wait until easter before I tell you? LOL

    I'll try to document everyting on the wiki soon.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.