Add curl one-liner install and rebuild-before-commit note

README: install straight from git with curl | sh, and a reminder to
rebuild dist/install-cabinchat.sh before every commit. Installer: usage
text no longer depends on reading its own file, so --help works when
piped into sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal Suter
2026-11-16 11:32:53 +01:00
co-authored by Claude Opus 5.5
parent 7e8d07e6c1
commit 863d30eeba
3 changed files with 26 additions and 5 deletions
+7 -4
View File
@@ -23,7 +23,10 @@ STAGE=/tmp/cabinchat-stage.$$
info() { echo ">> $*"; }
warn() { echo "WARNING: $*" >&2; }
die() { echo "ERROR: $*" >&2; rm -rf "$STAGE"; exit 1; }
usage() { sed -n '4,9p' "$0" | sed 's/^# \{0,1\}//'; }
usage() {
if [ -f "$0" ]; then sed -n '4,9p' "$0" | sed 's/^# \{0,1\}//'
else echo "usage: sh install-cabinchat.sh [-p <port> | wipe | uninstall]"; fi
}
listening() { netstat -tln 2>/dev/null | grep -qE "[:.]$1[[:space:]]"; }
@@ -46,9 +49,6 @@ remove_config() {
extract_payload() {
rm -rf "$STAGE"
mkdir -p "$STAGE" || die "cannot create $STAGE"
cat > "$STAGE/VERSION" <<'__CABINCHAT_EOF__'
3.0.0
__CABINCHAT_EOF__
mkdir -p "$STAGE/cgi-bin"
cat > "$STAGE/cgi-bin/chat" <<'__CABINCHAT_EOF__'
#!/bin/sh
@@ -1455,6 +1455,9 @@ if (nick) { $('me').textContent = nick; loop(); } else askName(true);
</script>
</body>
</html>
__CABINCHAT_EOF__
cat > "$STAGE/VERSION" <<'__CABINCHAT_EOF__'
3.0.0
__CABINCHAT_EOF__
[ -f "$STAGE/index.html" ] && [ -f "$STAGE/cgi-bin/chat" ] && [ -f "$STAGE/VERSION" ] \
|| die "installer payload is incomplete"