From 728c263c50852c58bdb77b033b946f84bd06a470 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Mon, 10 Jun 2019 23:55:53 -0500 Subject: [PATCH] add support for bash --- api/main.go | 1 + lxc/executors/bash | 2 ++ tests/test.sh | 1 + 3 files changed, 4 insertions(+) create mode 100644 lxc/executors/bash create mode 100644 tests/test.sh diff --git a/api/main.go b/api/main.go index da66fa2..423952e 100644 --- a/api/main.go +++ b/api/main.go @@ -61,6 +61,7 @@ func Execute(res http.ResponseWriter, req *http.Request) { "swift", "brainfuck", "bf", "rust", + "bash", } // check if the supplied language is supported diff --git a/lxc/executors/bash b/lxc/executors/bash new file mode 100644 index 0000000..07ee438 --- /dev/null +++ b/lxc/executors/bash @@ -0,0 +1,2 @@ +cd /tmp/$2 +runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 bash code.code" diff --git a/tests/test.sh b/tests/test.sh new file mode 100644 index 0000000..f2f0102 --- /dev/null +++ b/tests/test.sh @@ -0,0 +1 @@ +echo 'good'