Skip to content

Instantly share code, notes, and snippets.

@raine
Last active September 10, 2021 03:09
Show Gist options
  • Save raine/fdcc934d1ed4f0ae8204f64ff227a943 to your computer and use it in GitHub Desktop.
Save raine/fdcc934d1ed4f0ae8204f64ff227a943 to your computer and use it in GitHub Desktop.
Simple rust server finder for command-line
#!/usr/bin/env bash
# rust-servers
#
# Simple rust server finder for command-line.
# Useful for getting the map of your server.
#
# Requirements:
# - brew install fzf
# - npm install -g ramda-cli
SERVERS="http://playrust.io/servers.json"
selected=`curl -s $SERVERS | ramda --json-path '*' -c id | fzf -e` || exit 0
echo $selected | ramda -c -o table \
'-> it.mapurl = "http://map.playrust.io/?" + encodeURIComponent(if it.modded then it.endpoint else [ it.level, it.world.size, it.world.seed ].join("_")); it'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment