Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
openvpn service: source up/down scripts
source the up/down scripts instead of executing them to avoid loosing access to special variables like $1
- Loading branch information
Showing
1 changed file
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50ad243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fadenb, @grahamc, I don't understand the purpose of this modification. The
up
anddown
commands were embedded in-place into the up and down scripts, i.e. these commands were never executed as separate scripts. Now, after this change, they are written into separate files but thensource
d. This seems like the exact same thing we had before, only more complicated.Am I missing something?
50ad243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peti: Hmm, perhaps you are right. It might be possible that I used up/down differently than intended.
I was using them like
up = "/path/to/some/externally/managed/script.sh"
. The script I called tried to use $1 $2 ... to get MTU, IP and so on from OpenVPN and failed. I propably just could have used it likeup = "source /path/to/some/externally/managed/script.sh
or try to embed my whole script.50ad243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
50ad243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fadenb I think your options in the old system would have been
readFile /path/to/some/externally/managed/script.sh
or"source ${/path/to/some/externally/managed/script.sh}"
. I'd probably just switch it back, because most people probably pass in literal scripts rather than paths to them, and this change modifies the behavior in a breaking manner.50ad243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please revert.
50ad243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
50ad243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fadenb It would be useful to emit a warning if this option is a path. This would avoid other getting confused on this option again. Also add the content of 50ad243#commitcomment-21902824 to the documentation of these options.