Does the script have to be written in a file

Hi

I'm trying to follow the description of setting up a OpenVPN server from here:

I'm assuming that some of the code in the box is actually scripting language (Almquist). Does that have to be write into a file and then excited with as sh command?

Thanks

Sam

It is a script.

You can just copy and paste to the command line and it will execute directly in the shell.

You can create a file if you wish the execute the file.

2 Likes

Hi

That's great. The only thing is I'm trying to decode what the script is doing as I'd like to do it manually to understand what I'm doing.

Could anyone suggest a good site to learn the scripting language from?

Thank again

Sam

Before learning scripting you would get better benefit researching each of the commands used individually to understand their function, most of which will be found in openwrt wiki.

For scripting this is a good start

https://www.gnu.org/software/bash/manual/bash.html#Introduction

2 Likes

Just keep in mind that busybox's ash is not directly compatible with bash scripts, since bash has way more commands/features than ash. So read the bash documents, but keep in mind that you can not simply copy and paste code from there into scripts you want to run on your router (unless you are also prepared to install bash on the router).

3 Likes