summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--catsit.conf.58
-rw-r--r--service.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/catsit.conf.5 b/catsit.conf.5
index ccac76d..b7a45d4 100644
--- a/catsit.conf.5
+++ b/catsit.conf.5
@@ -1,4 +1,4 @@
-.Dd August 16, 2020
+.Dd March  1, 2021
 .Dt CATSIT.CONF 5
 .Os
 .
@@ -46,6 +46,12 @@ is executed using the shell.
 The shell variable
 .Va $0
 is set to the name of the service.
+If the command line
+does not contain the characters
+.Ql ;&|()
+it is prepended by
+.Ic exec
+when passed to the shell.
 .
 .It Ar @service Ar command ...
 Service names beginning with
diff --git a/service.c b/service.c
index 4ea9126..38049ff 100644
--- a/service.c
+++ b/service.c
@@ -246,7 +246,9 @@ void serviceStart(struct Service *service) {
 		if (len >= sizeof(command)) errx(ExitNoExec, "command truncated");
 	}
 	int n = snprintf(
-		&command[len], sizeof(command) - len, "exec %s", service->command
+		&command[len], sizeof(command) - len, "%s%s",
+		(service->command[strcspn(service->command, ";&|()")] ? "exec " : ""),
+		service->command
 	);
 	assert(n > 0);
 	len += n;
tr>2020-03-03Use getopts in shell scriptsJune McEnroe 2020-02-27Style %T outside of Rs in italicJune McEnroe 2020-02-26Add Fierce Femmes and Notorious LiarsJune McEnroe 2020-02-23Add This Is How You Lose the Time WarJune McEnroe 2020-02-22Add See Ya LaterJune McEnroe 2020-02-20Remove wiki scriptJune McEnroe 2020-02-19Add The Obelisk GateJune McEnroe 2020-02-17Add Four Tet — HandsJune McEnroe 2020-02-12Simplify macOS notify-sendJune McEnroe 2020-02-12Add imbox and notemap to pageJune McEnroe 2020-02-12Collapse simple linksJune McEnroe 2020-02-12Move catgirl up the pageJune McEnroe 2020-02-12Update catgirl pty grabJune McEnroe 2020-02-12Link to cgit /about pages where appropriateJune McEnroe 2020-02-11Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe 2020-01-28Change scout sensitivity to 1.4June McEnroe 2020-01-28Import shows.txtJune McEnroe