improved os detection
This commit is contained in:
parent
549b105bd6
commit
dd686ca0c6
16
installer.sh
16
installer.sh
|
@ -2,26 +2,20 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Detect the operating system
|
|
||||||
OS=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
|
OS=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
|
||||||
|
|
||||||
# Install Ruby, Nginx, and Git
|
# Install Ruby, Nginx, and Git
|
||||||
case $OS in
|
if [[ $OS == *"CentOS"* ]] || [[ $OS == *"Fedora"* ]]; then
|
||||||
"CentOS Linux"|"Fedora")
|
|
||||||
sudo yum install -y ruby nginx git
|
sudo yum install -y ruby nginx git
|
||||||
;;
|
elif [[ $OS == *"Arch"* ]]; then
|
||||||
"Arch Linux")
|
|
||||||
sudo pacman -Syu --noconfirm ruby nginx git
|
sudo pacman -Syu --noconfirm ruby nginx git
|
||||||
;;
|
elif [[ $OS == *"Debian"* ]] || [[ $OS == *"Ubuntu"* ]] || [[ $OS == *"Raspbian"* ]]; then
|
||||||
"Debian GNU/Linux"|"Ubuntu"|"Raspbian GNU/Linux")
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y ruby nginx git
|
sudo apt-get install -y ruby nginx git
|
||||||
;;
|
else
|
||||||
*)
|
|
||||||
echo "Unsupported operating system: $OS"
|
echo "Unsupported operating system: $OS"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
|
|
||||||
# Install the 'webrick' gem
|
# Install the 'webrick' gem
|
||||||
if ! gem list webrick -i > /dev/null; then
|
if ! gem list webrick -i > /dev/null; then
|
||||||
|
|
Loading…
Reference in New Issue