wip
This commit is contained in:
parent
ae0b6646a0
commit
aad629e3c0
1 changed files with 25 additions and 0 deletions
25
distros.sh
25
distros.sh
|
@ -38,10 +38,19 @@ echo_note() {
|
|||
command_exists() {
|
||||
command -v "$@" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
silentexec() {
|
||||
"$@" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
run() {
|
||||
if $silent; then
|
||||
silentexec "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
}
|
||||
|
||||
checkAndInstall() {
|
||||
for deps in "$@"; do
|
||||
if ! command_exists $deps; then
|
||||
|
@ -84,16 +93,32 @@ get_packager() {
|
|||
ubuntu="true"
|
||||
distro="ubuntu"
|
||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||
# Codename support
|
||||
case "$VERSION_CODENAME" in
|
||||
noble) noble=true ;;
|
||||
jammy) jammy=true ;;
|
||||
focal) focal=true ;;
|
||||
bionic) bionic=true ;;
|
||||
esac
|
||||
;;
|
||||
debian | kali | linuxmint | elementary | neon | kdeneon | deepin)
|
||||
debian="true"
|
||||
distro="debian"
|
||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||
case "$VERSION_CODENAME" in
|
||||
trixie) trixie=true ;;
|
||||
bookworm) bookworm=true ;;
|
||||
bullseye) bullseye=true ;;
|
||||
buster) buster=true ;;
|
||||
esac
|
||||
;;
|
||||
fedora | centos | rhel | rocky | almalinux)
|
||||
fedora="true"
|
||||
distro="fedora"
|
||||
_install() { $_sudo dnf install -y "$@"; }
|
||||
# Add version-specific var like: fedora_40=true
|
||||
fedora_version="fedora_${VERSION_ID//./_}"
|
||||
eval "$fedora_version=true"
|
||||
;;
|
||||
alpine)
|
||||
alpine="true"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue