From 4d39692075d5aaf117788a1a39a88386ce83cca2 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Mon, 15 May 2023 18:29:44 +0200 Subject: [PATCH] Update install.sh --- install.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 9f726fa..f4c37b5 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,6 @@ #!/bin/bash echo "Installing nfsense dev env..." +if [ "$(id -u)" -ne 0 ]; then echo "Please run as root." >&2; exit 1; fi cd /root echo "Disable firewalld" @@ -14,15 +15,16 @@ echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf sysctl -p echo "Setup Repos" -dnf install epel-release +dnf install epel-release -y /usr/bin/crb enable dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo echo "Installing Required Packages from Repos" -dnf install wget git systemd-networkd gh tcpdump nodejs dhcp-server unbound wireguard-tools +dnf install wget git systemd-networkd gh tcpdump nodejs dhcp-server unbound wireguard-tools tar -y echo "Installing pnpm" curl -fsSL https://get.pnpm.io/install.sh | sh - +source /root/.bashrc echo "Installing go" wget "https://go.dev/dl/go1.20.3.linux-amd64.tar.gz" @@ -34,7 +36,7 @@ source /etc/profile echo "Installing code server" curl -fsSL https://code-server.dev/install.sh | sh -mkdir /root/.config/code-server +mkdir -p /root/.config/code-server cat <> /root/.config/code-server/config.yaml bind-addr: 0.0.0.0:8081 auth: password @@ -96,6 +98,8 @@ EOT echo "reload systemd" systemctl daemon-reload +echo "Setup nfsense Config" +./nfsense --setup echo "Setup networkd" systemctl disable NetworkManager @@ -109,13 +113,10 @@ touch /etc/nftables/nfsense.conf systemctl enable nftables systemctl start nftables -echo "Default nfsense config" -./nfsense -default - echo "Starting nfsense" systemctl enable nfsense systemctl start nfsense systemctl enable nfsense-client systemctl start nfsense-client -echo "Done" \ No newline at end of file +echo "Done"