From aaf21e72d696c3483dbb4884a29ad7d41918aa01 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Wed, 1 Jul 2020 21:40:41 +0000 Subject: [PATCH 01/20] Update install.sh adding support for archlinux --- scripts/install.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 07d322e..dc3b6c2 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -125,13 +125,18 @@ sudo systemctl enable ssh sudo systemctl restart ssh # Additional tools fail2ban -sudo apt-get install -y dnsutils fail2ban +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + sudo apt-get install -y dnsutils fail2ban +elif ["$DISTRO" == "archlinux"]; then + # Install kernel headers if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ]; then sudo apt install -y linux-headers-$(uname -r) elif [ "$DISTRO" == "raspbian" ]; then sudo apt-get install -y raspberrypi-kernel-headers +elif ["$DISTRO" == "archlinux"]; then + sudo pacman -S --noconfirm linux-lts-headers fi # Wireugard @@ -143,7 +148,7 @@ sudo systemctl enable docker sudo systemctl start docker # Unattended upgrades -sudo apt-get install -y unattended-upgrades +#sudo apt-get install -y unattended-upgrades # Cockpit if [[ "$MISTBORN_INSTALL_COCKPIT" =~ ^([yY][eE][sS]|[yY])$ ]] @@ -174,12 +179,12 @@ IPV4_PUBLIC="10.2.3.1" #fi # unattended upgrades -sudo cp ./scripts/conf/20auto-upgrades /etc/apt/apt.conf.d/ -sudo cp ./scripts/conf/50unattended-upgrades /etc/apt/apt.conf.d/ +#sudo cp ./scripts/conf/20auto-upgrades /etc/apt/apt.conf.d/ +#sudo cp ./scripts/conf/50unattended-upgrades /etc/apt/apt.conf.d/ -sudo systemctl stop unattended-upgrades +#sudo systemctl stop unattended-upgrades sudo systemctl daemon-reload -sudo systemctl restart unattended-upgrades +#sudo systemctl restart unattended-upgrades # setup Mistborn services From 44e21f38c707287b547f2fa76b9563f92a2c8f99 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Wed, 1 Jul 2020 21:46:19 +0000 Subject: [PATCH 02/20] Update install.sh added archlinux support --- scripts/install.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index dc3b6c2..b7c4f5a 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -94,10 +94,18 @@ cd /opt/mistborn git submodule update --init --recursive # initial load update package list -sudo apt-get update +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + sudo apt-get update +elif ["$DISTRO" == "archlinux"]; then + sudo pacman -Syyy +fi # install figlet -sudo apt-get install -y figlet +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + sudo apt-get install -y figlet +elif ["$DISTRO" == "archlinux"]; then + sudo pacman -S --noconfirm figlet +fi # get os and distro source ./scripts/subinstallers/platform.sh @@ -128,6 +136,8 @@ sudo systemctl restart ssh if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then sudo apt-get install -y dnsutils fail2ban elif ["$DISTRO" == "archlinux"]; then + sudo pacman -S --noconfirm bind-tools fail2ban +fi # Install kernel headers From fc5e2d036cca71ea23e32c1c0b606c9f2aa0ee6f Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Wed, 1 Jul 2020 21:48:12 +0000 Subject: [PATCH 03/20] Update install.sh --- scripts/install.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index b7c4f5a..4acb8b3 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -93,6 +93,9 @@ pushd . cd /opt/mistborn git submodule update --init --recursive +# get os and distro +source ./scripts/subinstallers/platform.sh + # initial load update package list if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then sudo apt-get update @@ -107,10 +110,6 @@ elif ["$DISTRO" == "archlinux"]; then sudo pacman -S --noconfirm figlet fi -# get os and distro -source ./scripts/subinstallers/platform.sh - - # iptables echo "Setting up firewall (iptables)" if [ ! -f "/etc/iptables/rules.v4" ]; then @@ -139,7 +138,6 @@ elif ["$DISTRO" == "archlinux"]; then sudo pacman -S --noconfirm bind-tools fail2ban fi - # Install kernel headers if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ]; then sudo apt install -y linux-headers-$(uname -r) From ccfbd0fe9fe09392e6b274d5f6f5719a4637c163 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Wed, 1 Jul 2020 21:52:06 +0000 Subject: [PATCH 04/20] Update install.sh --- scripts/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 4acb8b3..065f476 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -99,14 +99,14 @@ source ./scripts/subinstallers/platform.sh # initial load update package list if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then sudo apt-get update -elif ["$DISTRO" == "archlinux"]; then +elif ["$DISTRO" == "arch"]; then sudo pacman -Syyy fi # install figlet if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then sudo apt-get install -y figlet -elif ["$DISTRO" == "archlinux"]; then +elif ["$DISTRO" == "arch"]; then sudo pacman -S --noconfirm figlet fi @@ -134,7 +134,7 @@ sudo systemctl restart ssh # Additional tools fail2ban if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then sudo apt-get install -y dnsutils fail2ban -elif ["$DISTRO" == "archlinux"]; then +elif ["$DISTRO" == "arch"]; then sudo pacman -S --noconfirm bind-tools fail2ban fi @@ -143,7 +143,7 @@ if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ]; then sudo apt install -y linux-headers-$(uname -r) elif [ "$DISTRO" == "raspbian" ]; then sudo apt-get install -y raspberrypi-kernel-headers -elif ["$DISTRO" == "archlinux"]; then +elif ["$DISTRO" == "arch"]; then sudo pacman -S --noconfirm linux-lts-headers fi From aef403c71074cdacf208511a0eac3e9eaf589ffb Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Wed, 1 Jul 2020 21:56:55 +0000 Subject: [PATCH 05/20] Update cockpit.sh added archlinux support --- scripts/subinstallers/cockpit.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/subinstallers/cockpit.sh b/scripts/subinstallers/cockpit.sh index 1a9d7f5..93d6f80 100755 --- a/scripts/subinstallers/cockpit.sh +++ b/scripts/subinstallers/cockpit.sh @@ -15,13 +15,25 @@ elif [ "$DISTRO" == "raspbian" ]; then echo "Raspbian repos contain cockpit" +elif [ "$DISTRO" == "arch"]; then + + echo "Arch Linux repos contrain cockpit" + fi -sudo apt-get install -y cockpit +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + sudo apt-get install -y cockpit +elif ["$DISTRO" == "arch"]; then + sudo pacman -S --noconfirm cockpit +fi -if $(sudo apt-cache show cockpit-docker > /dev/null 2>&1) ; then - # no longer supported upstream in Ubuntu 20.04 - sudo apt-get install -y cockpit-docker +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + if $(sudo apt-cache show cockpit-docker > /dev/null 2>&1) ; then + # no longer supported upstream in Ubuntu 20.04 + sudo apt-get install -y cockpit-docker + fi +elif ["$DISTRO" == "arch"]; then + sudo pacman -S --noconfirm cockpit-docker fi sudo cp ./scripts/conf/cockpit.conf /etc/cockpit/cockpit.conf From 9cf322e4515d67f4d287e2770da149d61851e162 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Wed, 1 Jul 2020 21:57:22 +0000 Subject: [PATCH 06/20] Update cockpit.sh typo fixed --- scripts/subinstallers/cockpit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/subinstallers/cockpit.sh b/scripts/subinstallers/cockpit.sh index 93d6f80..07ea9f2 100755 --- a/scripts/subinstallers/cockpit.sh +++ b/scripts/subinstallers/cockpit.sh @@ -17,7 +17,7 @@ elif [ "$DISTRO" == "raspbian" ]; then elif [ "$DISTRO" == "arch"]; then - echo "Arch Linux repos contrain cockpit" + echo "Arch Linux repos contain cockpit" fi From e932a685a0b3c442068584d0f30780a09c0f0814 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 10:09:15 +0000 Subject: [PATCH 07/20] Update docker.sh added archlinux support --- scripts/subinstallers/docker.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/subinstallers/docker.sh b/scripts/subinstallers/docker.sh index b21d452..81ea9e9 100755 --- a/scripts/subinstallers/docker.sh +++ b/scripts/subinstallers/docker.sh @@ -3,12 +3,20 @@ # Docker figlet "Mistborn: Installing Docker" -sudo apt update -sudo apt install -y python python3-pip python3-setuptools libffi-dev python3-dev libssl-dev +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + sudo apt-get update + sudo apt-get install -y python python3-pip python3-setuptools libffi-dev python3-dev libssl-dev +elif [ "$DISTRO" == "arch" ]; then + sudo pacman -Syyy + sudo pacman -S --noconfirm python python-pip python-setuptools libffi openssl +fi + if [ "$DISTRO" == "ubuntu" ] && [ "$VERSION_ID" == "20.04" ]; then echo "Automated Docker install" sudo apt-get install -y docker-compose +elif [ "$DISTRO" == "arch" ]; then + sudo pacman -S --noconfirm docker-compose else echo "Manual Docker installation" source ./scripts/subinstallers/docker_manual.sh From e4eb1e6a7c3790cfeeeb61c262a5937cadd9bf5a Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 10:09:43 +0000 Subject: [PATCH 08/20] Update docker.sh --- scripts/subinstallers/docker.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/subinstallers/docker.sh b/scripts/subinstallers/docker.sh index 81ea9e9..39247c0 100755 --- a/scripts/subinstallers/docker.sh +++ b/scripts/subinstallers/docker.sh @@ -16,6 +16,7 @@ if [ "$DISTRO" == "ubuntu" ] && [ "$VERSION_ID" == "20.04" ]; then echo "Automated Docker install" sudo apt-get install -y docker-compose elif [ "$DISTRO" == "arch" ]; then + echo "Automated Docker install" sudo pacman -S --noconfirm docker-compose else echo "Manual Docker installation" From 7b24fc9e18477697b6d64d0c2ee9b053f765bb5e Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 10:19:56 +0000 Subject: [PATCH 09/20] Update docker.sh --- scripts/subinstallers/docker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/subinstallers/docker.sh b/scripts/subinstallers/docker.sh index 39247c0..05b1bdb 100755 --- a/scripts/subinstallers/docker.sh +++ b/scripts/subinstallers/docker.sh @@ -16,8 +16,9 @@ if [ "$DISTRO" == "ubuntu" ] && [ "$VERSION_ID" == "20.04" ]; then echo "Automated Docker install" sudo apt-get install -y docker-compose elif [ "$DISTRO" == "arch" ]; then - echo "Automated Docker install" + echo "Semi-Automated Docker install" sudo pacman -S --noconfirm docker-compose + source ./scripts/subinstallers/docker_manual.sh else echo "Manual Docker installation" source ./scripts/subinstallers/docker_manual.sh From e5a5c2bf90d128b5fd9b5e7e1d7b0c8ebc9ab968 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 10:25:58 +0000 Subject: [PATCH 10/20] Update docker_manual.sh added archlinux support --- scripts/subinstallers/docker_manual.sh | 35 +++++++++++++++----------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/scripts/subinstallers/docker_manual.sh b/scripts/subinstallers/docker_manual.sh index 9692109..0096dc2 100755 --- a/scripts/subinstallers/docker_manual.sh +++ b/scripts/subinstallers/docker_manual.sh @@ -38,8 +38,12 @@ elif [ "$DISTRO" == "raspbian" ]; then fi # install Docker -echo "Installing docker" -sudo apt-get update +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + echo "Installing docker" + sudo apt-get update +fi + + if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ]; then sudo apt-get install -y docker-ce docker-ce-cli containerd.io @@ -52,17 +56,18 @@ fi # Docker group sudo usermod -aG docker $USER -# Docker Compose -echo "Installing Docker Compose" -#if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ]; then -# sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -# sudo chmod +x /usr/local/bin/docker-compose -#elif [ "$DISTRO" == "raspbian" ]; then -# Install required packages -sudo apt install -y python-backports.ssl-match-hostname - -# Install Docker Compose from pip -# This might take a while -sudo pip3 install docker-compose -#fi +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + # Docker Compose + echo "Installing Docker Compose" + #if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ]; then + # sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + # sudo chmod +x /usr/local/bin/docker-compose + #elif [ "$DISTRO" == "raspbian" ]; then + # Install required packages + sudo apt install -y python-backports.ssl-match-hostname + # Install Docker Compose from pip + # This might take a while + sudo pip3 install docker-compose + #fi +fi From c48ce64993a2e095687476f64c7482dd6a4e4558 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 10:43:19 +0000 Subject: [PATCH 11/20] Update iptables.sh added archlinux support --- scripts/subinstallers/iptables.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index 3715306..73d50c1 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -94,15 +94,22 @@ sudo ip6tables -P FORWARD DROP sudo ip6tables -P OUTPUT ACCEPT # iptables-persistent -if [ ! "$(dpkg-query -l iptables-persistent)" ]; then - echo "Installing iptables-persistent" +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + if [ ! "$(dpkg-query -l iptables-persistent)" ]; then + echo "Installing iptables-persistent" - # answer variables - echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections - echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections + # answer variables + echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections + echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections - # install - sudo apt-get install -y iptables-persistent ipset + # install + sudo apt-get install -y iptables-persistent ipset + else + echo "Saving iptables rules" + sudo bash -c "iptables-save > /etc/iptables/rules.v4" + echo "Saving ip6tables rules" + sudo bash -c "ip6tables-save > /etc/iptables/rules.v6" + fi else echo "Saving iptables rules" sudo bash -c "iptables-save > /etc/iptables/rules.v4" From 1c1f1a971a94fb3f1915ddd472571a76482a6e23 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 10:59:30 +0000 Subject: [PATCH 12/20] Update iptables.sh added archlinux support --- scripts/subinstallers/iptables.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index 73d50c1..77490b1 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -118,10 +118,18 @@ else fi # IP forwarding -sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf -sudo sysctl -p /etc/sysctl.conf +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf + sudo sysctl -p /etc/sysctl.conf +elif [ "$DISTRO" == "arch" ]; then + sudo echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/30-ipforward.conf + sudo sysctl -p /etc/sysctl.d/30-ipforward.conf +fi # rsyslog to create /var/log/iptables.log -sudo cp ./scripts/conf/15-iptables.conf /etc/rsyslog.d/ -sudo chown root:root /etc/rsyslog.d/15-iptables.conf -sudo systemctl restart rsyslog +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + sudo cp ./scripts/conf/15-iptables.conf /etc/rsyslog.d/ + sudo chown root:root /etc/rsyslog.d/15-iptables.conf + sudo systemctl restart rsyslog +fi +## implement archlinux alternativ From e20de2afa3e97e637f0413a6eb19e1aa36cd25ae Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 11:02:23 +0000 Subject: [PATCH 13/20] Update openssl.sh added archlinux support --- scripts/subinstallers/openssl.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/subinstallers/openssl.sh b/scripts/subinstallers/openssl.sh index e010fad..7a70cc6 100755 --- a/scripts/subinstallers/openssl.sh +++ b/scripts/subinstallers/openssl.sh @@ -8,7 +8,11 @@ CRT_PATH="$KEY_FOLDER/$CRT_FILE" KEY_PATH="$KEY_FOLDER/$KEY_FILE" # ensure openssl installed -sudo apt-get install -y openssl +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then + sudo apt-get install -y openssl +elif [ "$DISTRO" == "arch" ]; then + sudo pacman -S --noconfirm openssl +fi # make folder mkdir -p $KEY_FOLDER From e6d9d69b524ec6f537c9155bfa9d89dcaf5d89ce Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 11:07:27 +0000 Subject: [PATCH 14/20] Update wireguard.sh added archlinux support --- scripts/subinstallers/wireguard.sh | 47 +++++++++++++++++------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/scripts/subinstallers/wireguard.sh b/scripts/subinstallers/wireguard.sh index 93b2490..dc67102 100755 --- a/scripts/subinstallers/wireguard.sh +++ b/scripts/subinstallers/wireguard.sh @@ -3,30 +3,37 @@ figlet "Mistborn: Installing Wireguard" # if wireguard not in current repositories -if ! $(sudo apt-cache show wireguard > /dev/null 2>&1) ; then - # install PPAs +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + if ! $(sudo apt-cache show wireguard > /dev/null 2>&1) ; then + # install PPAs - echo "Adding Wireguard PPAs" + echo "Adding Wireguard PPAs" - # Wireguard - if [ "$DISTRO" == "raspbian" ]; then - echo "Adding Wireguard repo keys" - sudo apt-get install -y dirmngr - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC - fi + # Wireguard + if [ "$DISTRO" == "raspbian" ]; then + echo "Adding Wireguard repo keys" + sudo apt-get install -y dirmngr + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC + fi - if [ "$DISTRO" == "ubuntu" ]; then - # Ubuntu - sudo add-apt-repository -y ppa:wireguard/wireguard - elif [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then - # Debian - sudo bash -c 'echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list' - sudo bash -c "printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable" + if [ "$DISTRO" == "ubuntu" ]; then + # Ubuntu + sudo add-apt-repository -y ppa:wireguard/wireguard + elif [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then + # Debian + sudo bash -c 'echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list' + sudo bash -c "printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable" + fi fi fi echo "Installing Wireguard" -sudo apt-get update -sudo apt-get install -y openresolv wireguard +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then + sudo apt-get update + sudo apt-get install -y openresolv wireguard +elif [ "$DISTRO" == "arch" ]; then + sudo pacman -Syyy + sudo pacman -S --noconfirm openresolv wireguard-lts wireguard-tools +fi From 6c0ffa2cba89ac0f554e92941ff0519576e3f3ae Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 11:08:06 +0000 Subject: [PATCH 15/20] Update cockpit.sh --- scripts/subinstallers/cockpit.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/subinstallers/cockpit.sh b/scripts/subinstallers/cockpit.sh index 07ea9f2..104feb2 100755 --- a/scripts/subinstallers/cockpit.sh +++ b/scripts/subinstallers/cockpit.sh @@ -15,24 +15,24 @@ elif [ "$DISTRO" == "raspbian" ]; then echo "Raspbian repos contain cockpit" -elif [ "$DISTRO" == "arch"]; then +elif [ "$DISTRO" == "arch" ]; then echo "Arch Linux repos contain cockpit" fi -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then sudo apt-get install -y cockpit elif ["$DISTRO" == "arch"]; then sudo pacman -S --noconfirm cockpit fi -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then if $(sudo apt-cache show cockpit-docker > /dev/null 2>&1) ; then # no longer supported upstream in Ubuntu 20.04 sudo apt-get install -y cockpit-docker fi -elif ["$DISTRO" == "arch"]; then +elif [ "$DISTRO" == "arch" ]; then sudo pacman -S --noconfirm cockpit-docker fi From 0ac811350078cd03b60f9aac2e464699ddafb301 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 11:08:24 +0000 Subject: [PATCH 16/20] Update docker.sh --- scripts/subinstallers/docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/subinstallers/docker.sh b/scripts/subinstallers/docker.sh index 05b1bdb..d915ca6 100755 --- a/scripts/subinstallers/docker.sh +++ b/scripts/subinstallers/docker.sh @@ -3,7 +3,7 @@ # Docker figlet "Mistborn: Installing Docker" -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then sudo apt-get update sudo apt-get install -y python python3-pip python3-setuptools libffi-dev python3-dev libssl-dev elif [ "$DISTRO" == "arch" ]; then From 9664b8c57bdd6ffc62a3f8a42d136db603687944 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 11:08:53 +0000 Subject: [PATCH 17/20] Update docker_manual.sh --- scripts/subinstallers/docker_manual.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/subinstallers/docker_manual.sh b/scripts/subinstallers/docker_manual.sh index 0096dc2..c458bc4 100755 --- a/scripts/subinstallers/docker_manual.sh +++ b/scripts/subinstallers/docker_manual.sh @@ -38,7 +38,7 @@ elif [ "$DISTRO" == "raspbian" ]; then fi # install Docker -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then echo "Installing docker" sudo apt-get update fi From 5c9756cf9a68e4ab781763869c1be0863812dff8 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 11:09:01 +0000 Subject: [PATCH 18/20] Update docker_manual.sh --- scripts/subinstallers/docker_manual.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/subinstallers/docker_manual.sh b/scripts/subinstallers/docker_manual.sh index c458bc4..447918c 100755 --- a/scripts/subinstallers/docker_manual.sh +++ b/scripts/subinstallers/docker_manual.sh @@ -56,7 +56,7 @@ fi # Docker group sudo usermod -aG docker $USER -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then # Docker Compose echo "Installing Docker Compose" #if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ]; then From c1ee5061a03c578b92eaa49cd0213cc1e7cfb38d Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 11:10:25 +0000 Subject: [PATCH 19/20] Update iptables.sh --- scripts/subinstallers/iptables.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index 77490b1..f06ed5d 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -94,7 +94,7 @@ sudo ip6tables -P FORWARD DROP sudo ip6tables -P OUTPUT ACCEPT # iptables-persistent -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then if [ ! "$(dpkg-query -l iptables-persistent)" ]; then echo "Installing iptables-persistent" @@ -110,7 +110,7 @@ if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ras echo "Saving ip6tables rules" sudo bash -c "ip6tables-save > /etc/iptables/rules.v6" fi -else +elif [ "$DISTRO" == "arch" ]; then echo "Saving iptables rules" sudo bash -c "iptables-save > /etc/iptables/rules.v4" echo "Saving ip6tables rules" @@ -118,7 +118,7 @@ else fi # IP forwarding -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf sudo sysctl -p /etc/sysctl.conf elif [ "$DISTRO" == "arch" ]; then @@ -127,7 +127,7 @@ elif [ "$DISTRO" == "arch" ]; then fi # rsyslog to create /var/log/iptables.log -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then sudo cp ./scripts/conf/15-iptables.conf /etc/rsyslog.d/ sudo chown root:root /etc/rsyslog.d/15-iptables.conf sudo systemctl restart rsyslog From 2568454de537f6d276d27fd4117336d59c89f966 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Thu, 2 Jul 2020 11:11:16 +0000 Subject: [PATCH 20/20] Update wireguard.sh --- scripts/subinstallers/wireguard.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/subinstallers/wireguard.sh b/scripts/subinstallers/wireguard.sh index dc67102..e3cffc6 100755 --- a/scripts/subinstallers/wireguard.sh +++ b/scripts/subinstallers/wireguard.sh @@ -3,7 +3,7 @@ figlet "Mistborn: Installing Wireguard" # if wireguard not in current repositories -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then if ! $(sudo apt-cache show wireguard > /dev/null 2>&1) ; then # install PPAs @@ -30,7 +30,7 @@ if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ras fi echo "Installing Wireguard" -if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then +if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then sudo apt-get update sudo apt-get install -y openresolv wireguard elif [ "$DISTRO" == "arch" ]; then