Skip to content

Commit cd8f217

Browse files
committed
ipv6 support in install.sh
Signed-off-by: Scott R. Shinn <scott@atomicorp.com>
1 parent 6041c4a commit cd8f217

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ ConfigureClient()
379379
while [ 1 ]; do
380380
$ECHO " 3.1- ${serveraddr}: "
381381
read ADDRANSWER
382-
# Is it an IP?
383-
echo $ADDRANSWER | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" > /dev/null 2>&1
382+
# Is it an IP (v4 or v6)?
383+
echo $ADDRANSWER | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$|^[0-9a-fA-F:]+:[0-9a-fA-F:]+$" > /dev/null 2>&1
384384
if [ $? = 0 ]; then
385385
echo ""
386386
IP=$ADDRANSWER
@@ -859,7 +859,7 @@ AddWhite()
859859
for ip in ${IPS};
860860
do
861861
if [ ! "X${ip}" = "X" ]; then
862-
echo $ip | grep -Ei "^[0-9a-f.:/]{5,20}$" > /dev/null 2>&1
862+
echo $ip | grep -Ei "^[0-9a-f.:/]{5,45}$" > /dev/null 2>&1
863863
if [ $? = 0 ]; then
864864
echo " <allow_list>${ip}</allow_list>" >>$NEWCONFIG
865865
fi

0 commit comments

Comments
 (0)