Add json output of mcrcon from index of vouchers

This commit is contained in:
spengreb 2019-10-08 21:51:34 +02:00
parent 25bd47bf12
commit 46f3314738

View file

@ -6,9 +6,8 @@ class VouchersController < ApplicationController
def index
@vouchers = Voucher.all
whitelist = `mcrcon -H mine.vereto.net -p #{ENV["MC_RCON_PASS"]} 'whitelist list' | sed 's/There are*.*whitelisted players: //g'`.split(", ")
@vouchers.zip(whitelist)
render json: @vouchers
render json: { :vouchers => @vouchers, :whitelist => whitelist }.to_json
end
# GET /vouchers/1