verbose + systemd services

This commit is contained in:
Quentin 2021-01-27 09:11:22 +01:00
parent 1e58805b54
commit 0fdf5bad16
6 changed files with 38 additions and 3 deletions

23
scripts/2021/tor1wcli Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
while true; do
SOCK_PORT=$1
/usr/bin/tor \
--UseEntryGuards 0 \
--SocksPort "127.0.0.1:$SOCK_PORT IsolateDestPort IsolateDestAddr IsolateClientAddr" \
--DataDirectory /tmp/tor$SOCK_PORT &
sleep 5
/usr/local/bin/measlat \
-t tor \
-q $SOCK_PORT \
-h rayonx.machine.deuxfleurs.fr \
-p 443 \
-c 135000 \
-i 40 \
-s 172 \
-m tor1w
kill $!
done

View file

@ -0,0 +1,6 @@
[Unit]
Description=tor1wcli
[Service]
ExecStart=/usr/local/bin/tor1wcli %i
WorkingDirectory=/root/tor1wcli/

View file

@ -0,0 +1,6 @@
[Unit]
Description=tor1wserv
[Service]
ExecStart=/usr/local/bin/measlat -l -t tcp -p 443 -c 135000 -i 40 -s 172 -m tor1w
WorkingDirectory=/root/tor1wserv/

View file

@ -303,7 +303,7 @@ int on_socks5_failed_measlat(struct evt_core_ctx* ctx, struct evt_core_fdinfo* f
void register_categories(struct evt_core_ctx* evts, struct measlat_ctx* mctx) { void register_categories(struct evt_core_ctx* evts, struct measlat_ctx* mctx) {
struct evt_core_cat template = {0}; struct evt_core_cat template = {0};
template.app_ctx = mctx; template.app_ctx = mctx;
evt_core_init(evts, mctx->verbose); evt_core_init(evts, mctx->verbose <= 0 ? 0 : mctx->verbose - 1);
template.cb = on_timer; template.cb = on_timer;
template.name = "timer"; template.name = "timer";

View file

@ -150,7 +150,7 @@ int main(int argc, char** argv) {
}; };
measure_state_init (&tctx.mp, &tctx.ms); measure_state_init (&tctx.mp, &tctx.ms);
evt_core_init(&evts, tctx.verbose); evt_core_init(&evts, tctx.verbose <= 0 ? 0 : tctx.verbose - 1);
evt_core_add_cat(&evts, &tcp_co); evt_core_add_cat(&evts, &tcp_co);
evt_core_add_cat(&evts, &tcp_all); evt_core_add_cat(&evts, &tcp_all);
printf("--- Categories created\n"); printf("--- Categories created\n");

View file

@ -85,7 +85,7 @@ int main(int argc, char** argv) {
.flags = EPOLLIN | EPOLLET, .flags = EPOLLIN | EPOLLET,
.socklist = NULL .socklist = NULL
}; };
evt_core_init(&evts, uctx.verbose); evt_core_init(&evts, uctx.verbose <= 0 ? 0 : uc tx.verbose - 1);
evt_core_add_cat(&evts, &udp_read); evt_core_add_cat(&evts, &udp_read);
// 3. Register UDP socket // 3. Register UDP socket