Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

genclient.sh is ignoring parameters (o, z...) #217

Open
gonzalo opened this issue Sep 22, 2023 · 3 comments
Open

genclient.sh is ignoring parameters (o, z...) #217

gonzalo opened this issue Sep 22, 2023 · 3 comments

Comments

@gonzalo
Copy link
Contributor

gonzalo commented Sep 22, 2023

I have no problems on deploying image and using it but for some reason the genclient.sh script is just missing the paramters during the execution.

# docker exec dockovpn ./genclient.sh o
Fri Sep 22 15:53:56 2023 /opt/Dockovpn_data/clients/xxxxxxxxxxxxx/client.ovpn file has been generated
Fri Sep 22 15:53:56 2023 Config server started, download your client.ovpn config at http://xxxxxxxxxxxxxxx:80/
Fri Sep 22 15:53:56 2023 NOTE: After you download your client config, http server will be shut down!

(and keeps waiting until Ctrl-C)

I have the same behaviour if I run the command inside the container. It just seems that the "o" is missed when calling the function generateClientConfig(). Debugged up to line 100 on functions.sh

function generateClientConfig() {

    echo $#  <--- It shows a 0, so never goes inside the if statement
    CLIENT_PATH="$(createConfig)"
    CONTENT_TYPE=application/text
    FILE_NAME=client.ovpn
    FILE_PATH="$CLIENT_PATH/$FILE_NAME"

    if (($#)) 
    then

Amazing project BTW!

@scmanjarrez
Copy link
Contributor

scmanjarrez commented Sep 25, 2023

Yes, I noticed the same behaviour. Adding "$@" in genclient.sh fixes this problem:

#!/bin/bash

source ./functions.sh
generateClientConfig "$@"

@gonzalo
Copy link
Contributor Author

gonzalo commented Sep 25, 2023

You're right. Just tested and works for me also.

I've created a pull request to fix the problem

@scmanjarrez
Copy link
Contributor

This was already implemented in bbc9824. Closes #218.
@alekslitvinenk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants