diff --git a/runLogging b/runLogging old mode 100644 new mode 100755 index b74b68f522c5d6893c3b76216e9641657403415f..0473c769ba6cb09631281d289a877336fc7f41bf --- a/runLogging +++ b/runLogging @@ -1,6 +1,12 @@ #!/bin/bash + +if ! [ $(id -u) = 0 ]; then + echo "This script needs to be run as root." >&2 + exit 1 +fi + clear -echo "Starting logsystem" -touch ~/warnings.txt -sleep 3 -sudo glances -C glances.conf --export influxdb -q & \ No newline at end of file +echo "Starting logsystem..." +sudo -u $SUDO_USER touch ~/warnings.txt # Run as normal user, so the file is created in the right home directory +glances -C glances.conf --export influxdb -q & +echo "Done."