From fc3730a698f760fd8b1a436437806d936c98f5b7 Mon Sep 17 00:00:00 2001 From: 42 <42@42> Date: Wed, 2 Mar 2022 19:13:06 -0500 Subject: [PATCH] systemd unit --- .gitignore | 2 ++ ddos.service | 14 ++++++++++++++ deploy | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 ddos.service create mode 100755 deploy diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84bed4a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Makefile.local +_build diff --git a/ddos.service b/ddos.service new file mode 100644 index 0000000..739b002 --- /dev/null +++ b/ddos.service @@ -0,0 +1,14 @@ +[Unit] +Description=ddos + +[Service] +ExecStart=/home/debian/ddos.exe +StandardOutput=append:/home/debian/ddos.log +WorkingDirectory=/home/debian/ +User=debian +LimitNOFILE=100000 +Restart=on-failure + +[Install] +WantedBy=multi-user.target + diff --git a/deploy b/deploy new file mode 100755 index 0000000..e3ef920 --- /dev/null +++ b/deploy @@ -0,0 +1,42 @@ +#! /bin/bash +DIR=/home/user/QubesIncoming/dev/ +FILES="$DIR/ddos.exe $DIR/targets.txt $DIR/ddos.service" +H=$(echo -Hvps{00..29}) + +cmd() { + echo "[$(date +'%H:%M:%S') #] $*" >&2 + "$@" +} + +vps() +{ +cmd parallel-ssh -i $H "$@" +} + +apt() +{ +vps sudo apt update +vps sudo apt install -y libev4 libevent-2.1-7 ifstat strace ripgrep rsync +} + +setup() +{ +cmd parallel-rsync -vaz $H ddos.service /home/debian/ +vps sudo systemctl enable /home/debian/ddos.service +} + +deploy() +{ +for i in $FILES; do +cmd parallel-rsync -vaz $H $i /home/debian/ +done + +cmd rm -f $FILES +vps sudo systemctl restart ddos +} + +case "$1" in +apt) apt;; +setup) setup;; +*) deploy;; +esac -- 2.11.4.GIT