Skip to content

Commit

Permalink
fix vpn port regex
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed Mar 14, 2018
1 parent b628f22 commit e0aaeee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/root/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ if [[ $VPN_ENABLED == "yes" ]]; then
echo "[crit] VPN_REMOTE not found in ${VPN_CONFIG}, exiting..." | ts '%Y-%m-%d %H:%M:%.S' && exit 1
fi
export VPN_PORT=$(echo "${vpn_remote_line}" | grep -P -o -m 1 '(?<=\s)\d{2,5}(?=\s)?+' | sed -e 's~^[ \t]*~~;s~[ \t]*$~~')
export VPN_PORT=$(echo "${vpn_remote_line}" | grep -P -o -m 1 '\d{2,5}(\s?)+(tcp|udp|tcp-client)?$' | grep -P -o -m 1 '\d+' | sed -e 's~^[ \t]*~~;s~[ \t]*$~~')
if [[ ! -z "${VPN_PORT}" ]]; then
echo "[info] VPN_PORT defined as '${VPN_PORT}'" | ts '%Y-%m-%d %H:%M:%.S'
else
Expand Down

0 comments on commit e0aaeee

Please sign in to comment.