Skip to content

Conversation

@akabul0us
Copy link

A bit easier than manually editing all of the files and values from the README. I'll likely add some more features later (like recording changed values and resetting them as the new defaults) but as it is now this works just fine.

@AlexanderYastrebov
Copy link

IMO its better to add include/config.h and define all configurable values there.

@akabul0us
Copy link
Author

That would be a bit neater, rather than the current approach of having the values scattered across several files. This script would become simpler, too, as there'd be no need to make $file a variable.
I don't see any such header file in the repo - is this something you've implemented in another branch or fork?

@AlexanderYastrebov
Copy link

This script would become simpler

I don't think you'd need a script if all configurables are in the single place.

is this something you've implemented in another branch or fork?

No, just a drive-by suggestion :)

@akabul0us
Copy link
Author

akabul0us commented Jan 6, 2026

I don't think you'd need a script

That's the secret of shell scripts: nobody needs them, really 😁

@akabul0us
Copy link
Author

This pull request has been open for a month and I only just now realized that you're not the repo maintainer, so I kind of doubt either of our suggestions find their way into the code

@CompileasaService2026
Copy link

CompileasaService2026 commented Jan 15, 2026

Here is something similar to what I use for CompileasaService

#!/bin/bash
BUILD_ROOT="."
YOUR_SRV_IP=127.0.0.1
SRV_PORT=8081
PORT=8081
ICMP_MAGIC_SEQ=1337
MAGIC=mmtz

sed -i "s|#define YOUR_SRV_IP "."|#define YOUR_SRV_IP "$YOUR_SRV_IP"|" "$BUILD_ROOT/include/core.h"
sed -i "s|#define YOUR_SRV_IP ".
"|#define YOUR_SRV_IP "$YOUR_SRV_IP"|" "$BUILD_ROOT/include/core.h"
sed -i "s|#define SRV_PORT .|#define SRV_PORT "$SRV_PORT"|" "$BUILD_ROOT/modules/icmp.c"
sed -i "s|#define PORT .
|#define PORT "$PORT"|" "$BUILD_ROOT/modules/hiding_tcp.c"
sed -i "s|#define ICMP_MAGIC_SEQ .*|#define ICMP_MAGIC_SEQ $ICMP_MAGIC_SEQ|" "$BUILD_ROOT/modules/icmp.c"
sed -i "s|MAGIC=mtz|MAGIC=$MAGIC|g" "$BUILD_ROOT/modules/become_root.c"
find "$BUILD_ROOT" -type f -exec bash -c 'SAFE=$(printf "%s" "$0" | sed "s/[/&]/\\&/g"); sed -i "s/singularity/$SAFE/g" "$1"' "$NAME" {} ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants