From 467bb013e2353231774fe24be32a659b8e60d62e Mon Sep 17 00:00:00 2001 From: Piotr Cichosz Date: Mon, 27 May 2019 00:04:57 +0200 Subject: [PATCH] check if lxc-install executed as root --- docs/examples/lxc/lxc-install.sh | 4 ++++ docs/setup.rst | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/examples/lxc/lxc-install.sh b/docs/examples/lxc/lxc-install.sh index 830777d1e..d8fb06372 100644 --- a/docs/examples/lxc/lxc-install.sh +++ b/docs/examples/lxc/lxc-install.sh @@ -55,6 +55,10 @@ if [ -z $EMAIL ]; then echo "missing email, try running with -h " exit 3 fi +if [[ $(/usr/bin/id -u) -ne 0 ]]; then + echo "Not running as root" + exit +fi if [ $(grep -c paperless /etc/passwd) -eq 0 ]; then # Add paperless user with no password diff --git a/docs/setup.rst b/docs/setup.rst index 0a0d78d70..ac1b250e4 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -522,7 +522,7 @@ if the above assumptions are acceptable. .. code:: bash - $ lxc exec paperless -- sh -c "wget https://raw.githubusercontent.com/maur/paperless/master/docs/examples/lxc/lxc-install.sh && /bin/bash lxc-install.sh" + $ lxc exec paperless -- sh -c "wget https://raw.githubusercontent.com/maur/paperless/master/docs/examples/lxc/lxc-install.sh && /bin/bash lxc-install.sh --email" The script will ask you for an ftpupload password. As well as the super-user for paperless web front-end.