Remove useless function

This commit is contained in:
Yuk1n0 2021-07-10 18:25:26 +08:00
parent 06f2cf41a2
commit 770240e224
No known key found for this signature in database
GPG key ID: 19A0D6377E84BEE6

View file

@ -157,11 +157,6 @@ check_sys() {
fi
}
# autoconf_version
version_ge() {
test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"
}
# centosversion
getversion() {
if [[ -s /etc/redhat-release ]]; then
@ -208,24 +203,6 @@ debianversion() {
fi
}
autoconf_version() {
if [ ! "$(command -v autoconf)" ]; then
echo -e "[${green}Info${plain}] Starting install package autoconf"
if check_sys packageManager yum; then
yum install -y autoconf >/dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf"
elif check_sys packageManager apt; then
apt -y update >/dev/null 2>&1
apt -y install autoconf >/dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf"
fi
fi
local autoconf_ver=$(autoconf --version | grep autoconf | grep -oE "[0-9.]+")
if version_ge ${autoconf_ver} 2.67; then
return 0
else
return 1
fi
}
get_ip() {
local IP=$(ip addr | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | egrep -v "^192\.168|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-2]\.|^10\.|^127\.|^255\.|^0\." | head -n 1)
[ -z ${IP} ] && IP=$(wget -qO- -t1 -T2 ipv4.icanhazip.com)