#!/bin/sh
set -eu
case "${1:-help}" in
key) exec python3 /opt/tcpeasy/v1.3.0/configure.py --export;;
status) systemctl --no-pager status tcpeasy-decoder.service tcpeasy-xray.service;;
logs) journalctl -u tcpeasy-decoder.service -u tcpeasy-xray.service -n 80 --no-pager;;
stop) systemctl stop tcpeasy-xray.service tcpeasy-decoder.service;;
start) systemctl start tcpeasy-decoder.service tcpeasy-xray.service;;
*) echo 'sudo tcpeasy {key|status|logs|start|stop}';;
esac
