test/RUN_ONCE_AS_SUDO_FOR_TESTS.sh
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 18 Nov 2019 15:34:21 +0100
changeset 4205 f75e9274551f
parent 3244 bf242e94441c
permissions -rwxr-xr-x
Ugh. Old API.
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)