test/RUN_ONCE_AS_SUDO_FOR_TESTS.sh
author Volker Birk <vb@pep-project.org>
Fri, 17 May 2019 17:59:06 +0200
branchsync
changeset 3720 9ed76a79d784
parent 3244 bf242e94441c
permissions -rwxr-xr-x
...
krista@3244
     1
#!/bin/bash
krista@3244
     2
if [[ $EUID > 0 ]]
krista@3244
     3
  then echo "This script must be run with sudo."
krista@3244
     4
  exit
krista@3244
     5
fi
krista@3244
     6
krista@3244
     7
mkdir -p /run/user/$(id -u $SUDO_USER)
krista@3244
     8
chown $SUDO_USER /run/user/$(id -u $SUDO_USER)