shell bypass 403

UnknownSec Shell

: /usr/bin/ [ dr-xr-xr-x ]

name : crb
#!/bin/bash
#  Enable / Disable / Status the codeready-builder(CRB) or equivalent repo.

###############
# Show help
###############
usage() {
  echo "Usage `basename $0` [ enable | disable | status ] " >&2
  echo >&2
  echo "Enable, Disable, or give the status of the CodeReady Builder (CRB) repo" >&2
  echo >&2
  echo "Options:" >&2
  echo "  enable" >&2
  echo "    Enable the CRB repo" >&2
  echo "  disable" >&2
  echo "    Disable the CRB repo" >&2
  echo "  status" >&2
  echo "    Show if rhe CRB repo is enabled or disabled" >&2
  echo "  help" >&2
  echo "    Show this options menu" >&2
  echo >&2
  popd &>/dev/null
  exit 1
}


# Show the status
show_status()(
    # Determine if a version of CRB is enabled
    crb_repo=$(dnf repolist | grep -i -e crb -e powertools -e codeready | grep -v -i -e debug -e source -e eus -e virt -e rhui | awk '{print $1}')
    if [ "${crb_repo}" == "" ] ; then
        echo "CRB repo is disabled"
    else
        echo "CRB repo is enabled and named: ${crb_repo}"
    fi
)

# Enable or Disable the repo
enable_disable_repo(){
    command="$1"
    # Determine which repo we need to change
    crb_repo=$(dnf repolist --all | grep -i -e crb -e powertools -e codeready | grep -v -i -e debug -e source -e eus -e virt -e rhui | awk '{print $1}')

    # Determine if we are on RHEL or not, then do the correct steps
    source /etc/os-release
    if [[ "${NAME}" =~ "Red Hat" ]] ; then
        subscription-manager repos ${command} ${crb_repo}
    else
        # Determine if dnf-command(config-manager) is installed
        if ! rpm -q --whatprovides 'dnf-command(config-manager)' > /dev/null 2>&1 ; then
            echo "Error: Please run: dnf install 'dnf-command(config-manager)'" >&2
            echo "       before trying to enable/disable the CRB repo." >&2
            echo "Aborting"'!' >&2
            exit 1
        fi
        # Everything else uses dnf config-manager
        dnf config-manager ${command} ${crb_repo}
    fi
}

###############
# Get our arguments
###############
key="$1"
case $key in
enable | --enable )
    echo "Enabling CRB repo"
    enable_disable_repo --enable
    show_status
;;
disable | --disable )
    echo "Disabling CRB repo"
    enable_disable_repo --disable
    show_status
;;
status | --status )
    show_status
;;
* )
    usage
    exit 2
;;
esac

exit 0

© 2025 UnknownSec
Courses | Anyleson - Learning Platform
INR (₹)
India Rupee
$
United States Dollar

Courses

17 Courses
Course
Full Stack Web Development

Full Stack Web Development

in Web Development
83:20 Hours
10 Oct 2024
₹28,318.82
Course
Installment and Secure Host

Installment and Secure Host

in Business Strategy
5.00
1:30 Hours
16 Mar 2023
₹118
Course
New Update Features

New Update Features

in Language
4.00
1:30 Hours
21 Jun 2022
Free
Not conducted
Bestseller
New In-App Live System

New In-App Live System

in Communications
5.00
2:30 Hours
1 Mar 2026
₹11.80
Featured
New Learning Page

New Learning Page

in Lifestyle
5.00
3:30 Hours
1 Mar 2022
Free
Finished
How to Travel Around the World

How to Travel Around the World

in Lifestyle
5.00
2:30 Hours
2 Mar 2022
₹29.50

Type

More options