How to add a script

This is in my opinion a bit of a dumb question, but I want to add a script (Guest WiFi QR Code (via luci-app-commands?)) to my OpenWrt router.
Im not sure how to add a script - maybe I missed something in the guides.
So my questions are:
How to make a script and where should I save the script.
How to call the script or how works an automatic invoke of a script?


That thread contains a lot of information, so what you want might well be there. But you haven't really described what your ultimate goal is -- for example, where do you plan to show the QR code? How would a user get to the code -- is a privileged user required to give the code to someone else?

Please elaborate on what you ultimately hope to achieve.

Hey, thanks for your reply.
I had problems to create a script. That was my question.
Finally it was pretty simple.
I installed nano, created a file with .sh extension and executed it. It was more simple than I expected.
My Problem was just the missing informations about file extensions, where to save the file and how to execute the file.

opkg install nano

I installed at first a text editor.


I edited a file containing my script and saved the script as a file. The directory and the file extension wasn't important.
after that I had to invoke the script.
which was done by

. /myScript

(the space between dot and "/" should be more highlighted)
It's finally solved..

file extensions are not required in linux. But execute permissions are necessary.

That said, I am glad you have resolved the issue. If you have a moment, you might add some detail as to what you were missing so that future readers with similar questions can find the solutions here.

1 Like

Im not that often confronted with linux, but while reading this, it makes even more sense for me.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.