summaryrefslogtreecommitdiff
path: root/scripts/uchroot
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-09-01 22:12:47 +0200
committerKarel Kočí <cynerd@email.cz>2018-09-01 22:35:51 +0200
commitc64cf37fbd633a610b9be03de08593939546b01d (patch)
treee6de72b733cd23bff406a425c48ea7e867637fb5 /scripts/uchroot
parent68a776e88d83602c43d34636b7abde5196e50f37 (diff)
downloadlaminar-cnf-c64cf37fbd633a610b9be03de08593939546b01d.tar.gz
laminar-cnf-c64cf37fbd633a610b9be03de08593939546b01d.tar.bz2
laminar-cnf-c64cf37fbd633a610b9be03de08593939546b01d.zip
alpine-amd64: trying to build something
Diffstat (limited to 'scripts/uchroot')
-rwxr-xr-xscripts/uchroot9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/uchroot b/scripts/uchroot
index 77f3f10..e036ce2 100755
--- a/scripts/uchroot
+++ b/scripts/uchroot
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-[ $# -ge 1 ] || {
- echo "Usage: uchroot ROOT [CMD] [ARG].." >&2
+[ $# -ge 2 ] || {
+ echo "Usage: uchroot ROOT USER[:GROUP] [CMD] [ARG].." >&2
exit 1
}
@@ -11,7 +11,8 @@ fi
###############################################################
ROOT="$1"
-shift
+USERSPEC="$2"
+shift 2
[ -d "$ROOT" ] || {
echo "There is no such directory: $ROOT" >&2
exit 1
@@ -30,4 +31,4 @@ cp -f /etc/resolv.conf "$ROOT/etc/resolv.conf"
if [ $# -lt 1 ]; then
set "/bin/sh"
fi
-exec chroot "$ROOT" "$@"
+exec chroot --userspec="$USERSPEC" "$ROOT" "$@"