about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorg1n <g1n@ttm.sh>2021-07-05 17:01:04 +0000
committerg1n <g1n@ttm.sh>2021-07-05 17:01:04 +0000
commit968881cc5a532c9e568f482079efac0d4501ddf3 (patch)
tree5b04b5c6469527573c791a41a016cad250c9ce16
downloadlaconia-968881cc5a532c9e568f482079efac0d4501ddf3.tar.gz
Initial commit
-rw-r--r--README.md3
-rwxr-xr-xlaconia25
2 files changed, 28 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6512c49
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# Laconia 
+
+Simple spartan protocol client
diff --git a/laconia b/laconia
new file mode 100755
index 0000000..958576f
--- /dev/null
+++ b/laconia
@@ -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