Merge pull request #502 from qitechgmbh/fix-caps

Set caps also for real time
This commit is contained in:
Robin Krämer authored and GitHub committed 2025-07-21 15:54:48 +02:00
commit ebffbb69ec
1 file changed
+9 -7
+9 -7
View File
@@ -3,21 +3,23 @@
FEATURE=""
# Check if "mock-machine" was passed as an argument
if [ "$1" == "mock-machine" ]; then
if [[ "$1" == "mock-machine" ]]; then
echo "Building Debug Code with mock-machine feature"
FEATURE="--features mock-machine"
fi
if [[ "$1" == "release" ]]; then
echo "building Release Code"
cargo build --release
else
echo "Building Debug Code"
cargo build $FEATURE
fi
# Build the project with or without features
cargo build $FEATURE
# Only setcap if not building with mock-machine
if [ "$1" != "mock-machine" ]; then
echo "Setting capabilities for server executable"
sudo setcap cap_net_raw=eip ./target/debug/server
sudo setcap 'cap_net_raw,cap_sys_nice=eip' ./target/debug/server
fi
# Run the server
# run
./target/debug/server