Fedora Setup

This commit is contained in:
MangoPig
2026-05-29 15:57:17 +01:00
parent ad39f07b34
commit 5e7031d700
8 changed files with 338 additions and 98 deletions

View File

@@ -12,6 +12,8 @@ NC='\033[0m'
DEFAULT_USER="mangopig"
DEFAULT_UID="1000"
DEFAULT_GID="1000"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$SCRIPT_DIR/lib/distro.sh"
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}Please run this script as root.${NC}"
@@ -19,10 +21,6 @@ if [ "$EUID" -ne 0 ]; then
fi
echo -e "${YELLOW}LOG: Detecting OS...${NC}"
if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$ID
fi
echo -e "${YELLOW}LOG: Determining primary IPv4 address...${NC}"
if command -v hostname >/dev/null 2>&1 && hostname -I >/dev/null 2>&1; then
@@ -37,18 +35,29 @@ fi
echo -e "${YELLOW}LOG: Updating system and installing base tools...${NC}"
if [ "$OS" == "arch" ] || [ "$OS" == "manjaro" ]; then
if is_arch_family; then
pacman -Sy --noconfirm git make curl zsh sudo
SUDO_GROUP="wheel"
elif [ "$OS" == "ubuntu" ] || [ "$OS" == "debian" ]; then
elif is_debian_family; then
apt-get update
apt-get install -y git make curl sudo zsh
SUDO_GROUP="sudo"
elif is_fedora_family; then
if is_atomic_fedora; then
echo -e "${RED}Provisioning on Fedora atomic systems is not supported by this root script.${NC}"
echo -e "${RED}Use the normal user workflow and run make setup after login instead.${NC}"
exit 1
fi
dnf install -y git make curl sudo zsh
SUDO_GROUP="wheel"
else
echo -e "${RED}Unsupported OS: $OS${NC}"
exit 1
fi
ZSH_PATH="$(command -v zsh)"
if [ -t 0 ]; then
echo -e "${GREEN}---------------------------------------${NC}"
echo -e "${GREEN} USER PROVISIONING WIZARD ${NC}"
@@ -96,7 +105,7 @@ echo -e "${YELLOW}LOG: Configuring passwordless sudo...${NC}"
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/90-$USERNAME"
chmod 0440 "/etc/sudoers.d/90-$USERNAME"
if [ "$OS" == "arch" ]; then
if is_arch_family || is_fedora_family; then
sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
fi
@@ -106,4 +115,4 @@ sudo -u "$USERNAME" git clone https://git.mangopig.tech/MangoPig/Dot-Zsh.git "/h
echo -e "${GREEN}✅ Server Provisioned!"
echo -e "${GREEN} sudo su - $USERNAME${NC} OR logout and SSH back in as $USERNAME@$IP.${NC}"
echo -e "${GREEN} Then run cd ~/Config/Dot-Zsh && make setup ${NC}"
echo -e "${GREEN} Then run cd ~/Config/Dot-Zsh && make setup ${NC}"