Alekxsandr Posted February 6, 2022 Posted February 6, 2022 Hi! How can I run custom script on some event (for example, when internet connect or disconnect)? Quote
0 zyxmon Posted February 6, 2022 Posted February 6, 2022 https://github.com/ndmsystems/packages/wiki/Opkg-Component#hook-scripts Quote
0 Alekxsandr Posted February 6, 2022 Author Posted February 6, 2022 (edited) Thank you, but I not found info about installing this component 1. I used internal storage to add opkg without usb 2. loaded my script to storage (ddns.sh) 3. Checked - script running well when start it manually 4. No idea how to get Opkg Component working on my device.... Can you help me with more detailed info please? Edited February 6, 2022 by Alekxsandr Quote
0 zyxmon Posted February 6, 2022 Posted February 6, 2022 5 минут назад, Alekxsandr сказал: No idea how to get Opkg Component working on my device.... Can you help me with mo detail info please? It is already working on your device. Quote
0 Alekxsandr Posted February 6, 2022 Author Posted February 6, 2022 Do you mean, I just need to make those folders manually like mkdir -p /opt/etc/ndm/wan.d put inside my script and get profit? Quote
0 zyxmon Posted February 6, 2022 Posted February 6, 2022 1 минуту назад, Alekxsandr сказал: I just need to make those folders manually like In case of usb install - the folders are already there. I think in your case you need only to copy script in appropriate folder and make it executable. Add a logger call inside the script to check it is called as designed. Quote
0 Alekxsandr Posted February 6, 2022 Author Posted February 6, 2022 (edited) Tried with test script inside /opt/etc/ndm/button.d - no effect (pressing buttons not starting my test script) Edited February 6, 2022 by Alekxsandr Quote
0 sergeyk Posted February 6, 2022 Posted February 6, 2022 26 минут назад, Alekxsandr сказал: Tried with test script inside /opt/etc/ndm/button.d - no effect (pressing buttons not starting my test script) You should configure a custom action for the FN1 or FN2 button in the Web configurator also. Quote
0 zyxmon Posted February 6, 2022 Posted February 6, 2022 You may need to set PATH environment in your script or use full path name for echo -> /opt/bin/echo Quote
0 Alekxsandr Posted February 6, 2022 Author Posted February 6, 2022 Using full path for output file and configuring a custom action for the FN1 or FN2 button in the Web configuration has effect. Thanks a lot, guru! Now I'm sure it works. Quote
Question
Alekxsandr
Hi! How can I run custom script on some event (for example, when internet connect or disconnect)?
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.