Signed-off-by: Elvir Kuric <elvirkuric@gmail.com>
| ... | ... |
@@ -11,13 +11,17 @@ usage() {
|
| 11 | 11 |
$(basename $0) [OPTIONS] <name> |
| 12 | 12 |
OPTIONS: |
| 13 | 13 |
-y <yumconf> The path to the yum config to install packages from. The |
| 14 |
- default is /etc/yum.conf. |
|
| 14 |
+ default is /etc/yum.conf for Centos/RHEL and /etc/dnf/dnf.conf for Fedora |
|
| 15 | 15 |
EOOPTS |
| 16 | 16 |
exit 1 |
| 17 | 17 |
} |
| 18 | 18 |
|
| 19 | 19 |
# option defaults |
| 20 | 20 |
yum_config=/etc/yum.conf |
| 21 |
+if [ -f /etc/dnf/dnf.conf ] && command -v dnf &> /dev/null; then |
|
| 22 |
+ yum_config=/etc/dnf/dnf.conf |
|
| 23 |
+ alias yum=dnf |
|
| 24 |
+fi |
|
| 21 | 25 |
while getopts ":y:h" opt; do |
| 22 | 26 |
case $opt in |
| 23 | 27 |
y) |