#!/bin/bash

A="1050a"
result=$( grep -c "$A" /etc/issue )
if [ $result -ne 0 ]; then
	arch=$(arch)
	if [[ "$arch" == *"x86_64"* ]]; then
		unzip /opt/yum-utils-x86.zip
		cd /opt/yum-utils/
		yum localinstall *.rpm -y
		rpm -ivh https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/Extras/x86_64/Packages/UnionTech-repos-ufu-1-2.uelc20.x86_64.rpm
	else
		unzip /opt/yum-utils-arm.zip
		cd /opt/yum-utils/
		yum localinstall *.rpm -y
		rpm -ivh https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/Extras/aarch64/Packages/UnionTech-repos-ufu-1-2.uelc20.aarch64.rpm
	fi
else 
	arch=$(arch)
        if [[ "$arch" == *"x86_64"* ]]; then
		rpm -ivh https://euler-packages.chinauos.com/server-euler/ufu/fuyu/1050/everything/x86_64/Packages/UnionTech-repos-ufu-1-2.uel20.x86_64.rpm --nodeps
	else
 		rpm -ivh https://euler-packages.chinauos.com/server-euler/ufu/fuyu/1050/everything/aarch64/Packages/UnionTech-repos-ufu-1-2.uel20.aarch64.rpm --nodeps
	fi
fi
