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_exists() {
|
||||||
command -v "$@" >/dev/null 2>&1
|
command -v "$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
silentexec() {
|
silentexec() {
|
||||||
"$@" >/dev/null 2>&1
|
"$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run() {
|
||||||
|
if $silent; then
|
||||||
|
silentexec "$@"
|
||||||
|
else
|
||||||
|
"$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
checkAndInstall() {
|
checkAndInstall() {
|
||||||
for deps in "$@"; do
|
for deps in "$@"; do
|
||||||
if ! command_exists $deps; then
|
if ! command_exists $deps; then
|
||||||
|
@ -84,16 +93,32 @@ get_packager() {
|
||||||
ubuntu="true"
|
ubuntu="true"
|
||||||
distro="ubuntu"
|
distro="ubuntu"
|
||||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
_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 | kali | linuxmint | elementary | neon | kdeneon | deepin)
|
||||||
debian="true"
|
debian="true"
|
||||||
distro="debian"
|
distro="debian"
|
||||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
_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 | centos | rhel | rocky | almalinux)
|
||||||
fedora="true"
|
fedora="true"
|
||||||
distro="fedora"
|
distro="fedora"
|
||||||
_install() { $_sudo dnf install -y "$@"; }
|
_install() { $_sudo dnf install -y "$@"; }
|
||||||
|
# Add version-specific var like: fedora_40=true
|
||||||
|
fedora_version="fedora_${VERSION_ID//./_}"
|
||||||
|
eval "$fedora_version=true"
|
||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
alpine="true"
|
alpine="true"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue