Open ksmathers opened 8 years ago
@ksmathers the provided command will output a list of the server ports without information for which server they are. Similarly the msm command msm all config server-port
will show only the port numbers without information about the server. Please provide an example of the expected output i.e.
vanilla server-port 25565 bukkit server-port 25567
or however you like it to look like.
Sidenote: such excessive piping is unnecessary imo. I would use something in the vein of
find /opt/msm/servers/ -name server.properties \
-exec awk -F= '/server-port/ {printf "%-5s %s\n",$2,$1}' {} \;
One command and one subcommand.
Awk has a built-in FILENAME variable that could help get the path of the config file -- this could be fun to build into msm.
I find that I'm frequently adding and removing servers and need a way of figuring out which server ports are available and which are in use, so this is an enhancement request. Something like the following would be useful: cd /opt/msm/servers && find . -name server.properties | xargs grep server-port | perl -nle 'printf( "%-5s %s\n",$2,$1) if /\/(\w+)\/.*port=(\d+)/' | sort -n