#!/bin/bash
# 在repo.sckj.tech的f40容器里执行
RPM_PATH=/opt/hypernet/common/rpm
rm -rf $RPM_PATH
dnf install --releasever=40 --downloadonly --installroot=/tmp/installroot --downloaddir=$RPM_PATH freeipa-server freeipa-server-trust-ad freeipa-server-dns freeipa-client freeipa-client-epn samba-dc samba-client krb5-workstation pwgen -y
createrepo $RPM_PATH
tm=$(date +%Y%m%d)
pushd /opt/hypernet/common
tar cvfz rpm-${tm}.tgz rpm
popd
rm rpm.tgz
mv /opt/hypernet/common/rpm-${tm}.tgz .
ln -s rpm-${tm}.tgz rpm.tgz
rm -rf /tmp/installroot
