Check public network ok or not during locally deploy Compass CI, because users need to sparrow in a pure intranet environment.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- lib/check_public_network.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/check_public_network.sh
diff --git a/lib/check_public_network.sh b/lib/check_public_network.sh new file mode 100644 index 0000000..19a0f02 --- /dev/null +++ b/lib/check_public_network.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +public_network_ok() +{ + ping -c 1 -w 1 114.114.114.114 >/dev/null 2>&1 +}