Skip to content

Commit 8273f0d

Browse files
committed
Add Checking Distro [ Arch Fedora]
1 parent 49e400e commit 8273f0d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

install/arch-setup.sh

+9
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ COLOR_YELLOW="\e[33m"
99
COLOR_CYAN="\e[36m"
1010
COLOR_RED="\e[31m"
1111

12+
if [ -f /etc/os-release ]; then
13+
DISTRO=$(grep ^NAME= /etc/os-release | cut -d= -f2 | tr -d '"')
14+
elif command -v lsb_release &>/dev/null; then
15+
DISTRO=$(lsb_release -d | cut -f2)
16+
else
17+
DISTRO="Unknown Linux Distribution"
18+
fi
19+
1220
echo -e "${COLOR_CYAN}"
1321
figlet -f slant "Carch"
1422
echo "Version $VERSION"
23+
echo "Distribution: $DISTRO"
1524
echo -e "${COLOR_RESET}"
1625

1726
echo -e "${COLOR_YELLOW}Select installation type:${COLOR_RESET}"

install/fedora-setup.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ COLOR_GREEN="\e[32m"
77
COLOR_YELLOW="\e[33m"
88
COLOR_CYAN="\e[36m"
99
COLOR_RED="\e[31m"
10-
COLOR_BLUE="\e[34m"
1110

1211
VERSION="4.1.2"
1312
TARGET_DIR="/usr/bin"
@@ -45,9 +44,18 @@ install_rust
4544

4645
clear
4746

47+
if [ -f /etc/os-release ]; then
48+
DISTRO=$(grep ^NAME= /etc/os-release | cut -d= -f2 | tr -d '"')
49+
elif command -v lsb_release &>/dev/null; then
50+
DISTRO=$(lsb_release -d | cut -f2)
51+
else
52+
DISTRO="Unknown Linux Distribution"
53+
fi
54+
4855
echo -e "${COLOR_CYAN}"
4956
figlet -f slant "Carch"
5057
echo "Version $VERSION"
58+
echo "Distribution: $DISTRO"
5159
echo -e "${COLOR_RESET}"
5260

5361
CHOICE=$(gum choose "Rolling Release" "Stable Release" "Cancel")

0 commit comments

Comments
 (0)