12 if [ $?
!= 0 -a -d "$1" ]
15 if [ -d /var
/run
/empty
]
17 emptydir
=/var
/run
/empty
18 elif [ -d /var
/empty
]
23 emptydir
=/var
/run
/empty
25 mount
-o bind "$emptydir" "$1"
28 echo "Unable to hide \`$1'. Exiting." >&2
46 echo "Usage: $0 [--netdev] [--dir DIR1:DIR2:...] [--fstype TYPE1,TYPE2,...] [cmd [args...]]" >&2
59 for t
in "${types[@]}"
72 echo "Unknown option: $1" >&2
92 exec unshare
-m -- $0 -u "${myargs[@]}"
97 if [ ${#dirs[@]} = 0 -a ${#types[@]} = 0 ]
102 for d
in "${dirs[@]}"
107 while read mntdev mntpnt mntype mntopt rest
111 if [[ "$mntdev" =~ ^
// ]] ||
[[ "$mntdev" =~
: ]]
118 if [ "${types_k[$mntype]}" = 1 ]
122 for typepatt
in "${types[@]}"
124 typepatt
=${typepatt//./\\.}
125 typepatt
=${typepatt//\*/.*}
126 typepatt
=${typepatt//\?/.}
127 if [[ "$mntype" =~ ^
$typepatt$
]]
136 for d
in "${!dirs_k[@]}"