mCaptcha/network.sh
2021-03-26 22:18:01 +05:30

36 lines
394 B
Bash
Executable file

set -e
launch_kv() {
bash -c "exec -a kv ./target/debug/kv-test-util $1"
}
kill_kv() {
kill -9 $(pidof kv)
}
help() {
cat << EOF
USAGE:
./network.sh
launch launches key-value server
kill kills key-value server
EOF
}
if [ -z $1 ]
then
help
elif [ $1 == 'launch' ]
then
if [ -z $2 ]
then
help
else
launch_kv $2
fi
elif [ $1 == 'kill' ]
then
kill_kv
else
help
fi