You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
357 B
22 lines
357 B
#!/bin/sh
|
|
|
|
lower=/cfg/preserve/${1}
|
|
upper=/cfg/overlay/${1}
|
|
work=/cfg/overlay/${1}_work
|
|
target=${2}
|
|
|
|
if [ ! -d "$target" ]; then
|
|
exit
|
|
fi
|
|
|
|
if [ -d "$lower" ]; then
|
|
if [ -d "$upper" ]; then
|
|
mkdir -p "$work"
|
|
mount -t overlay overlay \
|
|
-olowerdir=${lower},upperdir=${upper},workdir=${work} \
|
|
${target}
|
|
else
|
|
mount --bind "$lower" "$target"
|
|
fi
|
|
fi
|