From fbb97918cf92b52db1bdb4d766d278f73f17bd62 Mon Sep 17 00:00:00 2001 From: Ryan Schlesinger Date: Sat, 18 Feb 2017 14:09:19 -0800 Subject: [PATCH] Only load config from temp file if not empty --- bin/ovpn_genconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/ovpn_genconfig b/bin/ovpn_genconfig index c1b88ae..a21bc1b 100755 --- a/bin/ovpn_genconfig +++ b/bin/ovpn_genconfig @@ -267,8 +267,10 @@ fi [ -z "$OVPN_PORT" ] && OVPN_PORT=1194 [ -z "$CUSTOM_ROUTE_CONFIG" ] && process_route_config "192.168.254.0/24" -# Save extra client config -OVPN_ADDITIONAL_CLIENT_CONFIG=$(cat $TMP_EXTRA_CLIENT_CONFIGFILE) +# Save extra client config from temp file only if temp file is not empty +if [ -s "$TMP_EXTRA_CLIENT_CONFIGFILE" ]; then + OVPN_ADDITIONAL_CLIENT_CONFIG=$(cat $TMP_EXTRA_CLIENT_CONFIGFILE) +fi export OVPN_SERVER OVPN_ROUTES OVPN_DEFROUTE export OVPN_SERVER_URL OVPN_ENV OVPN_PROTO OVPN_CN OVPN_PORT