Wireguard roadwarrior scripts - problems

Hi,

I try to use these scripts:
https://openwrt.org/docs/guide-user/services/vpn/wireguard/road-warrior
I think I did the prerequisites - installing the needed packages, installing the scripts by ssh and nano.

But I get errors in both scripts:
(I had some wg config from prior test, but also tried to remove the "wg" parts from "networks", "firewall" and deleted "wgserver".

OpenWrt 23.05.5, r24106-10cc5fcd00

=========================================================
|               Automated WireGuard Script              |
|                 Add road-warrior peer                 |
=========================================================
IPv4 only tunnel
only providing tunnel ingress via IPv4
Checking variables... using new peer ID 1 for mobil
Done
./add_roadwarrior_peer.sh#: line 269: syntax error: unexpected end of file (expecting "}")


root@Acheron:~# sh ./wg_roadwarrior.sh#
======================================
|     Automated WireGuard Script     |
|     road-warrior server setup      |
======================================
Defining variables... IPv4 only mode
Done
Creating directories and pre-defining permissions on those directories... Done
Removing pre-existing WireGuard interface... Disabling pre-existing firewall script... Done
Generating WireGuard server keys for 'vpn' network... Done
Creating WireGuard interface for 'vpn' network... Done
Adding firewall rules for 'vpn' network... ./wg_roadwarrior.sh#: line 282: syntax error: unexpected end of file (expecting "fi")

Please read the error message. There is a syntax error.
Besides that. Setting up wg is so stupid simple why do anyone even need a random helper script from some random script kiddie?

I know it should be simple... This is now my third attempt, and still no luck. Ok, might be that the issue is on the Android client side.

I understand that there is an syntax error.
But I don't understand where... just used the exact script from the "official" openwrt site.

Mit freundlichen Grüßen,
Florian Reus

You probably forgot to add a closing } in the script after editing.

I wouldn't call random scripts from the wiki official at all. Given that everyone can edit it use these with a grain of salt.

Start with one client connection and do it manually.
If you later need to add like 20 clients then sure use a script but to understand the setup it's better to do it yourself.

You were right, it is really simple to set it up.
My problem in my previous tries was that I had no hint that I need to restart WG interface after each change during the tests.