mirror of
https://github.com/ChrisTitusTech/mybash.git
synced 2026-04-04 19:48:22 +00:00
feat(distribution function): added ID_LIKE check
This commit is contained in:
26
.bashrc
26
.bashrc
@@ -366,7 +366,31 @@ distribution ()
|
||||
dtype="slackware"
|
||||
;;
|
||||
*)
|
||||
# If ID is not recognized, keep dtype as unknown
|
||||
# Check ID_LIKE only if dtype is still unknown
|
||||
if [ -n "$ID_LIKE" ]; then
|
||||
case $ID_LIKE in
|
||||
*fedora*|*rhel*|*centos*)
|
||||
dtype="redhat"
|
||||
;;
|
||||
*sles*|*opensuse*)
|
||||
dtype="suse"
|
||||
;;
|
||||
*ubuntu*|*debian*)
|
||||
dtype="debian"
|
||||
;;
|
||||
*gentoo*)
|
||||
dtype="gentoo"
|
||||
;;
|
||||
*arch*)
|
||||
dtype="arch"
|
||||
;;
|
||||
*slackware*)
|
||||
dtype="slackware"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# If ID or ID_LIKE is not recognized, keep dtype as unknown
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user