uci-docker-build/core/opt/bin/map-host-id

12 lines
316 B
Plaintext
Raw Normal View History

#!/bin/bash
vdirs=${1:-$VOLUME_DIRS}
if [[ $vdirs ]]; then
echo changing ownership of directories $vdirs
vgroup=host
[[ ! $USER = "root" && $USER ]]; vgroup=$USER
vmap=${HOST_MAP:-host:$vgroup}
echo to $vmap
declare usesudo
[[ ! $USER = "root" ]] && usesudo=sudo
$usesudo chown -R $vmap $vdirs
fi