What's new

Script Question

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

drinkingbird

Part of the Furniture
I've got a script running at services-start to do some vlan configs.

If I make changes to certain things, it often gets overwritten requiring a reload or manual run of the script.

I'm looking at running the same script against service-event-end for a few different services to see if that reapplies the configs automatically whenever that event happens

But I'm not clear on how to pass the two required arguments to the script - normally if running it by hand you simply specify them after the command, but if these are supposed to be automated, are the arguments put in the script?

I'm probably not understanding this particular script, maybe it has to be called from another script or something....

Thx
 
The firmware calls service-event-end with the two parameters after it has finished processing the original command. You wouldn’t run the script manually or from any other script.
 
The firmware calls service-event-end with the two parameters after it has finished processing the original command. You wouldn’t run the script manually or from any other script.
So how do I tell it to run on say wireless restart? Or does it just run on every service event?
 
So how do I tell it to run on say wireless restart? Or does it just run on every service event?
It runs on every event and you have to check $2 = wireless for example. Put an empty service-event-end script in place and watch the syslog to observe which parameters get passed.
 
It runs on every event and you have to check $2 = wireless for example. Put an empty service-event-end script in place and watch the syslog to observe which parameters get passed.

Well, the script I have doesn't hurt anything if it gets run again (just overwrites what is there), so I guess that may be what I'm looking for. Just need to look at what kind and how many of service events there are, don't want it running every time someone gets a DHCP IP or joins/leaves the wifi.....
 
It runs on every event and you have to check $2 = wireless for example. Put an empty service-event-end script in place and watch the syslog to observe which parameters get passed.

So I could either just let it run after every service event which is probably excessive, or use "if" or whatever type of filter to only look for things like restart wireless, restart firewall, etc. Think I get it now.

Thanks
 
So I could either just let it run after every service event which is probably excessive, or use "if" or whatever type of filter to only look for things like restart wireless, restart firewall, etc. Think I get it now.

Thanks
Under normal steady operation, you won’t see many service events. During boot up, it could be a lot.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top