mirror of
https://github.com/pygos/init-scripts.git
synced 2024-11-14 17:07:11 +01:00
021fa43244
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
21 lines
357 B
Bash
Executable file
21 lines
357 B
Bash
Executable file
#!/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
|