fileinfo/configure

46 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2024-08-22 00:09:40 +03:00
#!/bin/bash
# Function to install libmagic-dev on Debian-based distros
install_debian() {
echo "Detected Debian-based distro. Installing libmagic-dev..."
2024-10-17 17:56:16 +03:00
# if [ "$EUID" -ne 0 ]
2024-10-17 17:54:28 +03:00
sudo apt-get update
sudo apt-get install -y libmagic-dev
2024-10-17 17:56:16 +03:00
# else
# apt-get update
# apt-get install -y libmagic-dev
# fi
2024-08-22 00:09:40 +03:00
}
# Function to install file-devel on Red Hat-based distros
install_redhat() {
echo "Detected Red Hat-based distro. Installing file-devel..."
2024-10-17 17:56:16 +03:00
# if [ "$EUID" -ne 0 ]
2024-10-17 17:54:28 +03:00
sudo yum install -y file-devel
2024-10-17 17:56:16 +03:00
# else
# yum install -y file-devel
# fi
2024-08-22 00:09:40 +03:00
}
# Function to install libmagic on Arch-based distros
install_arch() {
echo "Detected Arch-based distro. Installing libmagic..."
sudo pacman -Syu --noconfirm
sudo pacman -S --noconfirm libmagic
}
# Detect Linux distro and install appropriate package
if [ -f /etc/debian_version ]; then
install_debian
elif [ -f /etc/redhat-release ]; then
install_redhat
elif [ -f /etc/arch-release ]; then
install_arch
else
echo "Unsupported Linux distribution. Please install libmagic manually."
exit 1
fi
echo "Installation complete!"