mirror of
https://github.com/pygos/init-scripts.git
synced 2024-11-22 12:19:46 +01:00
Cleanup overlay script
- Create the upper and work dirs if they don't exist yet. - If the target doesn't exist, let it fail. The configuration is bonkers. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
parent
98d5ba81be
commit
36c14c147d
1 changed files with 4 additions and 14 deletions
|
@ -5,17 +5,7 @@ upper=/cfg/overlay/${1}
|
||||||
work=/cfg/overlay/${1}_work
|
work=/cfg/overlay/${1}_work
|
||||||
target=${2}
|
target=${2}
|
||||||
|
|
||||||
if [ ! -d "$target" ]; then
|
mkdir -p "$work" "$upper"
|
||||||
exit
|
mount -t overlay overlay \
|
||||||
fi
|
-olowerdir=${lower},upperdir=${upper},workdir=${work} \
|
||||||
|
"$target"
|
||||||
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
|
|
||||||
|
|
Loading…
Reference in a new issue