From 968881cc5a532c9e568f482079efac0d4501ddf3 Mon Sep 17 00:00:00 2001 From: g1n Date: Mon, 5 Jul 2021 17:01:04 +0000 Subject: [PATCH] Initial commit --- README.md | 3 +++ laconia | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 README.md create mode 100755 laconia 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