Skip to content

Commit

Permalink
强化获取IP结果检测
Browse files Browse the repository at this point in the history
  • Loading branch information
若海 committed Mar 3, 2021
1 parent ba3a2a4 commit db88bc2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Updating Record for test.rehi.org

2021/3/3

- 强化获取IP结果检测
- 优化部分判断逻辑
- 优化消息输出

Expand Down
10 changes: 10 additions & 0 deletions ardnspod
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ arWanIp4() {
fi
fi

if [ -z "$hostIp" ]; then
echo "arWanIp4 - Can't get ip address"
return 1
fi

if [ -n "$(echo $hostIp | grep -Ev '^[0-9\.]+$')" ]; then
echo "arWanIp4 - Invalid ip address $hostIp"
return 1
Expand All @@ -75,6 +80,11 @@ arWanIp6() {
;;
esac

if [ -z "$hostIp" ]; then
echo "arWanIp6 - Can't get ip address"
return 1
fi

if [ -n "$(echo $hostIp | grep -Ev '^[0-9a-fA-F:]+$')" ]; then
echo "arWanIp6 - Invalid ip address"
return 1
Expand Down
6 changes: 3 additions & 3 deletions ddnspod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ arToken="12345,7676f344eaeaea9074c123451234512d"
# Place each domain you want to check as follows
# you can have multiple arDdnsCheck blocks

# IPv6:
arDdnsCheck "test.org" "subdomain6" 6

# IPv4:
arDdnsCheck "test.org" "subdomain"

# IPv6:
arDdnsCheck "test.org" "subdomain6" 6

0 comments on commit db88bc2

Please sign in to comment.