test/RUN_ONCE_AS_SUDO_FOR_TESTS.sh
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Fri, 10 May 2019 14:07:57 +0200
branchsync
changeset 3660 5baccf081566
parent 3244 bf242e94441c
permissions -rwxr-xr-x
Upgraded to cpptest 2.0.0 compatibility - pre 2.0.0 cpptest will no longer compile! (There's no define to operate on for conditional compilation here, so I am just unilaterally upgrading, since the release is from January, and the previous release is more than 2 years old...
     1 #!/bin/bash
     2 if [[ $EUID > 0 ]]
     3   then echo "This script must be run with sudo."
     4   exit
     5 fi
     6 
     7 mkdir -p /run/user/$(id -u $SUDO_USER)
     8 chown $SUDO_USER /run/user/$(id -u $SUDO_USER)