aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgi-bin/get.sh
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-03-03 23:25:52 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-03-03 23:25:52 +0300
commitc0068e035ca825579e8d41f60d3864eeb6df0c88 (patch)
tree5fd91401c25214e4ab9d916482c9f567c00c39a1 /cgi-bin/get.sh
parentmerge {reboot,poweroff}.sh into get.py (diff)
downloadlinux-status-c0068e035ca825579e8d41f60d3864eeb6df0c88.tar.gz
linux-status-c0068e035ca825579e8d41f60d3864eeb6df0c88.zip
no more CGI
The server.py script now launches a web server and handles all the requests internally, without delegating anything to external scripts.
Diffstat (limited to '')
-rwxr-xr-xcgi-bin/get.sh17
1 files changed, 0 insertions, 17 deletions
diff --git a/cgi-bin/get.sh b/cgi-bin/get.sh
deleted file mode 100755
index ea4f4ce..0000000
--- a/cgi-bin/get.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-
-set -o errexit -o nounset -o pipefail
-
-script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
-script_dir="$( cd -- "$script_dir" && pwd )"
-readonly script_dir
-
-# Python's http.server runs CGI scripts under user nobody.
-# This is not what we want unfortunately.
-# The best solution I could find so far is to create an entry in
-# /etc/sudoers.d, allowing the nobody user to run the real scripts w/ sudo.
-if [ "$( id --user --name )" == nobody ]; then
- sudo --non-interactive --preserve-env "$script_dir/get.py"
-else
- "$script_dir/get.py"
-fi