Skip to content

Commit fbb9791

Browse files
committed
Only load config from temp file if not empty
1 parent e282e1e commit fbb9791

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/ovpn_genconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,10 @@ fi
267267
[ -z "$OVPN_PORT" ] && OVPN_PORT=1194
268268
[ -z "$CUSTOM_ROUTE_CONFIG" ] && process_route_config "192.168.254.0/24"
269269

270-
# Save extra client config
271-
OVPN_ADDITIONAL_CLIENT_CONFIG=$(cat $TMP_EXTRA_CLIENT_CONFIGFILE)
270+
# Save extra client config from temp file only if temp file is not empty
271+
if [ -s "$TMP_EXTRA_CLIENT_CONFIGFILE" ]; then
272+
OVPN_ADDITIONAL_CLIENT_CONFIG=$(cat $TMP_EXTRA_CLIENT_CONFIGFILE)
273+
fi
272274

273275
export OVPN_SERVER OVPN_ROUTES OVPN_DEFROUTE
274276
export OVPN_SERVER_URL OVPN_ENV OVPN_PROTO OVPN_CN OVPN_PORT

0 commit comments

Comments
 (0)