Skip to content

Commit 381a663

Browse files
committed
Fixed issue if no config is present
Fixed issue, that OpenVPN spams output with repeating messages of error. Now OpenVPN starts only if config is presents, else container is sleeping forever until config is present & container is restarted.
1 parent a50c17b commit 381a663

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Logging chaned to stdout, no more log file by default
99
- Added **firewall disable** feature to disable all firewall related modifications
1010
- Added `ìp6tables` & more permissions to *ip utils*
11+
- Run OpenVPN only if config is present in `/config/openvpn/server` else **sleep forever** until config was setup & **CONTAINER RESTART**
1112

1213
### 1.0.4 - IPv6 docs, improved wizards
1314

root/etc/services.d/openvpn/run

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
#!/usr/bin/with-contenv bash
22

3-
sudo -E -u abc openvpn --cd /config --config ${OVPN_RUN}
3+
CONFIGS=$(ls -1 /config/openvpn/server | wc -l) # Get number of files in /config/openvpn/server
4+
if [ $CONFIGS -gt 0 ]; then
5+
# Run OpenVPN server only if configs are present
6+
echo "Running OpenVPN ..."
7+
sudo -E -u abc openvpn --cd /config --config ${OVPN_RUN}
8+
else
9+
# No OpenVPN config present
10+
echo "No OpenVPN config present"
11+
12+
# Do nothing until container restart
13+
while true
14+
do
15+
sleep 3600
16+
done
17+
fi

0 commit comments

Comments
 (0)