mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
Create simple CLI tool to communicate with the Nibriboard server
This commit is contained in:
parent
722e6bbeb8
commit
1b28b309ce
1 changed files with 24 additions and 0 deletions
24
nibriboardctl
Normal file
24
nibriboardctl
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
################################### Settings ###################################
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# The port the nibriboard command server is listening on
|
||||||
|
port=31587;
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
command="$@";
|
||||||
|
|
||||||
|
if [[ "${command}" == "" ]]; then
|
||||||
|
command="help";
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${command}" | nc ::1 $port;
|
||||||
|
exit_code=$?;
|
||||||
|
|
||||||
|
if [[ "${exit_code}" -ne "0" ]]; then
|
||||||
|
echo -e "nibriboardctl: Can't contact the command server at [::1]:$port";
|
||||||
|
exit ${exit_code};
|
||||||
|
fi
|
Loading…
Reference in a new issue