Quantcast
Channel: User mikyll98 - Stack Overflow
Viewing all articles
Browse latest Browse all 115

Answer by mikyll98 for Kubernetes: kubectl exec command different behaviour from C# program

$
0
0

Update: I still haven't figured out why it doesn't work but managed to find a workaround.

Workaround Solution

I created a shell script that does what I need: updates a property of the server.properties file:

#!/bin/bashproperty=$1 # property to changenewVal=$2   # value to assign to the propertysed -i "s/^${property}=.*/${property}=${newVal}/" server.properties

which I call from the C# application, passing the values I need, as follows:

ExecCommand(serverName, $"/bin/bash update-server-property.sh gamemode {newValue}");

This way the file gets updated as it should :)


Viewing all articles
Browse latest Browse all 115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>