#!/bin/bash

_install() {
	# Remove Hosts Config
	sed -i "/softlib.service.ucloud.cn/d" /etc/hosts
	sed -i "/yum.service.ucloud.cn/d" /etc/hosts

	if [[ $ARCH == "aarch64" ]];then
local NIC_CONF=/etc/sysconfig/network-scripts/ifcfg-net1
cat > $NIC_CONF <<end
DEVICE=net1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPV6INIT=no
end
	fi

}

_check() {
	_check="PASS"

	grep -q "softlib.service.ucloud.cn" /etc/hosts
	if [ $? -eq 0 ];then
		_check="FAIL"
		PRINT_ERR "[ERROR] softlib.service.ucloud.cn Had Not Been Deleted From /etc/hosts."
	fi

        sed -i "/yum.service.ucloud.cn/d" /etc/hosts
	grep -q "yum.service.ucloud.cn" /etc/hosts
	if [ $? -eq 0 ];then
		_check="FAIL"
		PRINT_ERR "[ERROR] yum.service.ucloud.cn Had Not Been Deleted From /etc/hosts."
	fi

	sed -i "/uconf.service.ucloud.cn/d" /etc/hosts
	grep -q "uconf.service.ucloud.cn" /etc/hosts
	if [ $? -eq 0 ];then
		_check="FAIL"
		PRINT_ERR "[ERROR] uconf.service.ucloud.cn Had Not Been Deleted From /etc/hosts."
	fi
}
