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

12 lines
316 B
Bash
Executable File

#!/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