about summary refs log tree commit diff stats
path: root/laconia
diff options
context:
space:
mode:
Diffstat (limited to 'laconia')
-rwxr-xr-xlaconia25
1 files changed, 25 insertions, 0 deletions
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