Tobias Begalke 6 anni fa
parent
commit
454af4de4a
2 ha cambiato i file con 42 aggiunte e 0 eliminazioni
  1. 27 0
      build-deb.sh
  2. 15 0
      scw-cap.service

+ 27 - 0
build-deb.sh

@@ -0,0 +1,27 @@
+#!/bin/bash
+
+DESTDIR=./dist
+VERSION=$(git describe --tag | sed 's/^v//')
+ITERATION=1
+NAME=scw-cap
+
+rm -rf $DESTDIR
+install -d $DESTDIR/{usr/bin,etc/systemd/system,etc/$NAME,usr/share/$NAME}
+make
+
+install -m 755 munchclient $DESTDIR/usr/bin/$NAME
+install -m 644 munchclient.toml $DESTDIR/etc/$NAME/$NAME.toml
+install -m 644 munchclient.toml $DESTDIR/usr/share/$NAME/$NAME.toml
+# install -m 644 munchclient.service $DESTDIR/etc/systemd/system/$NAME.service
+# install -m 644 ca-chain.cert.pem $DESTDIR/usr/share/$NAME/
+
+fpm -s dir -t deb -C $DESTDIR --name $NAME \
+  --version $VERSION \
+  --iteration $ITERATION \
+  --deb-systemd $NAME.service \
+  --description "ScraperWall Packet Capture" \
+  --config-files /etc/$NAME/$NAME.toml \
+  -p ./debian
+
+rm -rf $DESTDIR
+

+ 15 - 0
scw-cap.service

@@ -0,0 +1,15 @@
+[Unit]
+Description=ScraperWall packet capture
+After=network.target
+
+[Service]
+EnvironmentFile=-/etc/default/scw-cap
+ExecStart=/usr/bin/scw-cap -config /etc/scw-cap/scw-cap.toml
+User=root
+Group=root
+Restart=always
+RestartSec=1
+
+[Install]
+WantedBy=multi-user.target
+