From cc59d13b1af0134e32416b3a02f81a757572b87a Mon Sep 17 00:00:00 2001 From: bivashko-cyberhaven Date: Mon, 28 Feb 2022 09:51:58 +0200 Subject: [PATCH 1/2] Install script --- install.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..ff1b4f2a --- /dev/null +++ b/install.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +REPO="Arriven/db1000n" +INSTALL_OS="unknown" +case "$OSTYPE" in + solaris*) INSTALL_OS="solaris" ;; + darwin*) INSTALL_OS="darwin" ;; + linux*) INSTALL_OS="linux" ;; + bsd*) INSTALL_OS="bsd" ;; + msys*) INSTALL_OS="windows" ;; + cygwin*) INSTALL_OS="windows" ;; + *) echo "unknown: $OSTYPE"; exit 1 ;; +esac + +INSTALL_ARCH="unknown" +OSARCH=$(uname -m) +case "$OSARCH" in + x86_64*) INSTALL_ARCH="amd64" ;; + i386*) INSTALL_ARCH="386" ;; + arm*) INSTALL_ARCH="arm" ;; + *) echo "unknown: $OSARCH"; exit 1 ;; +esac + +INSTALL_VERSION="${INSTALL_OS}-${INSTALL_ARCH}" + +curl https://api.github.com/repos/${REPO}/releases/latest | grep "${INSTALL_VERSION}" | grep -Eo 'https://[^\"]*' | xargs wget + +INSTALL_TAG=$(curl --silent "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + +ARCHIVE="db1000n-${INSTALL_TAG}-${INSTALL_VERSION}.tar.gz" + +cat ${ARCHIVE} | md5sum | awk '{ print $1 }' > md5sum.txt + +if ! cmp --silent "${ARCHIVE}.md5" "md5sum.txt"; then + echo "md5sum for ${ARCHIVE} failed. Please check the md5sum. File may possibly be corrupted." + exit 1 +fi + +tar xvf ${ARCHIVE} \ No newline at end of file From 3bd41ccb3180b848312b7a3e5b3bc58a02d50a63 Mon Sep 17 00:00:00 2001 From: bivashko-cyberhaven Date: Mon, 28 Feb 2022 09:59:50 +0200 Subject: [PATCH 2/2] Update README with an install script --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 03512332..fd8a270a 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,22 @@ I will update both the repo and this readme as I go during following days (date Synflood implementation is taken from https://github.com/bilalcaliskan/syn-flood and slightly patched. I couldn't just import the package as all the functionality code was in an internal package preventing import into other modules. Will figure it out better later (sorry to the owner). +## How to install +### binary install -# How to install - -## binary install go to releases page and install latest version for your os +### go install -## go install +run command in your terminal -run command in your terminal ``` go install github.com/Arriven/db1000n@latest ~/go/bin/db1000n ``` -## docker install +### docker install how to install docker? @@ -37,6 +36,15 @@ https://docs.docker.com/desktop/windows/#resources https://docs.docker.com/desktop/mac/#resources run d1000n + ``` docker run ghcr.io/arriven/db1000n:latest ``` + +### shell install + +run install script directly into the shell (useful for install through ssh) + +``` +curl https://raw.githubusercontent.com/Arriven/db1000n/main/install.sh | sh +```