if [[ -z ${UNSHARE} ]] ; then
mount_args=
if type -P unshare >&/dev/null ; then
+ test_arg() { unshare "$@" -- true >&/dev/null && uargs+=( "$@" ); }
uargs=( -m )
- unshare -u -- true >&/dev/null && uargs+=( -u )
- unshare -i -- true >&/dev/null && uargs+=( -i )
- unshare -p -- true >&/dev/null && uargs+=( -p -f --mount-proc )
+ test_arg -u
+ test_arg -i
+ test_arg -p -f --mount-proc
+ test_arg --propagation=private
UNSHARE=true exec unshare "${uargs[@]}" -- "$0" "$@"
fi
else