Initial commit

This commit is contained in:
g1n 2021-07-05 17:01:04 +00:00
commit 968881cc5a
2 changed files with 28 additions and 0 deletions

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Laconia
Simple spartan protocol client

25
laconia Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
PROGNAME=${0##*/}
VERSION="0.0.1"
URI=$( echo $1 | sed -e 's/spartan:\/\///' )
error_exit() {
printf "%s: %s\n" "$PROGNAME" "${1:-"Unknown Error"}" >&2
exit 1
}
usage() {
printf "usage: %s [OPTIONS] URL [ARGS]\n" "$PROGNAME"
printf "Simple client for spartan protocol\n"
}
case $1 in
-h | --help)
usage; exit ;;
-* | --*)
usage; error_exit "unknown option $1" ;;
*)
printf "GET / 0\r\n" | nc $1 300 -4
;;
esac