Fixed getting vpn_remote_line if there are no spaces
This commit is contained in:
parent
11404ae043
commit
a668334f5b
@ -117,7 +117,7 @@ if [[ $VPN_ENABLED == "yes" ]]; then
|
||||
if [[ "${VPN_TYPE}" == "openvpn" ]]; then
|
||||
export vpn_remote_line=$(cat "${VPN_CONFIG}" | grep -P -o -m 1 '(?<=^remote\s)[^\n\r]+' | sed -e 's~^[ \t]*~~;s~[ \t]*$~~')
|
||||
else
|
||||
export vpn_remote_line=$(cat "${VPN_CONFIG}" | grep -P -o -m 1 '(?<=^Endpoint\s)[^\n\r]+' | sed -e 's~^[=\ ]*~~')
|
||||
export vpn_remote_line=$(cat "${VPN_CONFIG}" | grep -P -o -m 1 '(?<=^Endpoint)(\s{0,})[^\n\r]+' | sed -e 's~^[=\ ]*~~')
|
||||
fi
|
||||
|
||||
if [[ ! -z "${vpn_remote_line}" ]]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user