File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ services:
76
76
77
77
| ** Parameter** | ** Function** |
78
78
| :-----------:| :----------:|
79
+ | ` -e CONFIG=test.conf ` | Config file name|
79
80
| ` -e FAIL_MODE=hard ` | Restart whole container on error|
80
81
| ` -e PUID=1000 ` | for UserID - see below for explanation|
81
82
| ` -e PGID=1000 ` | for GroupID - see below for explanation|
Original file line number Diff line number Diff line change 10
10
11
11
config=" $( ovpn-confpath) "
12
12
13
- device=" $( cat $OPENVPN_DIR / $config | sed -n -re ' s/^\s* dev\s*(\w+)\s*$/\1/p ' ) "
13
+ device=" $( ovpn- dev) "
14
14
if [ -z " $device " ]; then
15
15
echo ' Interface not set'
16
16
exit 1
Original file line number Diff line number Diff line change 27
27
config=" $( ovpn-confpath) "
28
28
29
29
# Configured interface
30
- device=" $( cat $OPENVPN_DIR / $config | sed -n -re ' s/^\s* dev\s*(\w+)\s*$/\1/p ' ) "
30
+ device=" $( ovpn- dev) "
31
31
if [ -z " $device " ]; then
32
32
echo ' Interface not set'
33
33
exit 1
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/with-contenv bash
2
+ #
3
+ # Prints OpenVPN device
4
+ #
5
+
6
+ config=$(ovpn-confpath)
7
+ if [ -z "$config" ]; then
8
+ exit 0
9
+ fi
10
+
11
+ device="$(cat $OPENVPN_DIR/$config | sed -n -re 's/^\s*dev\s*(\w+)\s*$/\1/p')"
12
+ echo "$device"
You can’t perform that action at this time.
0 commit comments