]> git.wh0rd.org Git - home.git/commitdiff
check $ID rather than writable root
authorMike Frysinger <vapier@gentoo.org>
Sun, 16 Feb 2014 11:05:35 +0000 (06:05 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 16 Feb 2014 11:05:35 +0000 (06:05 -0500)
.bin/custom-chroot

index 42b0c5a6c25e59a506545f0f6437181a08727788..c6e3164041b9c75eb84c6506c8f06b87bf95e103 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash -e
 
 bootstrap() {
-       [[ -w / ]] || exec sudo env -uUNSHARE HOME="$HOME" "$0" "$@"
+       [[ $(id -u) -eq 0 ]] || exec sudo env -uUNSHARE HOME="$HOME" "$0" "$@"
 
        if [[ -z ${UNSHARE} ]] ; then
                mount_args=