File remove-repository of Package kimi-utils-fedora

#!/usr/bin/env bash
if [ "$EUID" -ne 0 ]; then
    echo "Please run as root"
    echo "or use sudo before command:"
    echo "sudo remove-repository"
    exit
fi
DEPENDENCIES="dnf-plugins-core"
CHECK_PACKAGES_CMD="rpm -q $DEPENDENCIES"
INSTALL_MISSING_PACKAGES=$($CHECK_PACKAGES_CMD | grep "is not installed" | awk '{ print $2 }')
if [ -n "$INSTALL_MISSING_PACKAGES" ]; then
    #echo "not empty"
    echo "These packages seems to be missing:"
    echo
    $CHECK_PACKAGES_CMD | grep "is not installed" | awk '{ print $2 }'echo
    echo "These packages need to be installed: $INSTALL_MISSING_PACKAGES"
    dnf install $INSTALL_MISSING_PACKAGES
fi
echo
echo "These repositories match your request:"
echo
echo "Running command:"
echo "    dnf repolist | grep --color=always $1"
echo
dnf repolist | grep --color=always $1
echo
echo "Waiting 7 seconds ..."
sleep 1
echo "..."
sleep 1
echo "Tip: Hit Ctrl+C to abort ..."
sleep 1
echo -n "."
sleep 1
echo -n "."
sleep 1
echo -n "."
sleep 1
echo -n "."
sleep 1
echo "Executing command:"
echo "    sudo dnf config-manager --set-disabled $1"
echo
dnf config-manager --set-disabled $1
echo
echo "[OK] Did as you requested."
echo "Repository $1 should now be disabled, if it existed."
echo "If repository $1 was not on your system, you will see"
echo "an error message about that. Nothing to worry about."
echo "Otherwise, please specify a valid repository name"
echo "among the repositories on your system:"
echo
echo "Running command:"
echo "    dnf repolist | grep --color=always $1"
echo
echo "Current repositories on your system:"
echo
sleep 1
dnf repolist
echo
exit 0
openSUSE Build Service is sponsored by