osi-tools/osi-mount

14 lines
287 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
# 2018 Luke Shumaker
{
set -euE
source "${BASH_SOURCE[0]%/*}/lib/osi.sh"
needs_root
arg_device=$1
arg_mountpoint=$2
arg_cmd=("${@:3}")
2018-08-11 21:38:08 +00:00
unshare --mount sh -c "mount --make-rslave / && mount -- ${arg_device@Q} ${arg_mountpoint@Q} && exec -- ${arg_cmd[*]@Q}"
}