summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--spawn.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/spawn.sh b/spawn.sh
new file mode 100644
index 0000000..052a7fd
--- /dev/null
+++ b/spawn.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+set -eu
+
+die() {
+	echo "${0}:" "$@" >&2
+	exit 1
+}
+
+: ${SPAWND_PIPE:=/var/run/spawnd.pipe}
+
+while getopts 'c:' opt; do
+	case "${opt}" in
+		(c) SPAWND_PIPE=$OPTARG;;
+		(?) exit 1;;
+	esac
+done
+shift $((OPTIND - 1))
+
+if ! [ -p "${SPAWND_PIPE}" ]; then
+	die "${SPAWND_PIPE} is not a named pipe"
+fi
+
+[ $# -lt 1 ] && die 'action required'
+[ $# -lt 2 ] && die 'service name required'
+
+action=$(echo "${1}" | tr 'A-Z' 'a-z')
+for valid in start stop restart status $(kill -l | tr 'A-Z' 'a-z'); do
+	[ "${action}" = "${valid}" ] && break
+done
+if [ "${action}" != "${valid}" ]; then
+	die "${action} is not a valid action or signal"
+fi
+
+echo "$@" > "${SPAWND_PIPE}"
catgirl/commit/chat.c?h=1.9a&id=0e99c4891229b7e1c84d476ac9c6848a8098fa84&follow=1'>Handle KICK and NICKJune McEnroe 2018-08-03Continue on EINTR from pollJune McEnroe Resizing the terminal causes it. 2018-08-03Handle ACTIONsJune McEnroe 2018-08-03Use more octal char literalsJune McEnroe I might be coming around to octal. 2018-08-03Send a WHO in response to NAMES to get usernamesJune McEnroe Other than this slight hack, I think coloring by username rather than nick is a much better idea. 2018-08-03Colorize nicks and channelsJune McEnroe 2018-08-03Add support for mIRC colorsJune McEnroe 2018-08-03Handle bold, italic, underlineJune McEnroe 2018-08-03Add prift function for "prefix shift"June McEnroe Forgive me. 2018-08-03Link with -lcurseswJune McEnroe 2018-08-02Use libtls "compat" ciphersJune McEnroe irc.mozilla.org, using GnuTLS, doesn't support *any* of the "secure" ciphers! 2018-08-02Add UI and handle some kinds of server messagesJune McEnroe Seems like handling input is going to be the worst thing ever. 2018-08-02Add chroot.tar targetJune McEnroe