mirror of
https://github.com/pygos/init.git
synced 2024-11-25 20:40:48 +01:00
22 lines
389 B
Bash
22 lines
389 B
Bash
|
#!/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
|
||
|
@BINPATH@/mkdir -p "$work"
|
||
|
@SBINPATH@/mount -t overlay overlay \
|
||
|
-olowerdir=${lower},upperdir=${upper},workdir=${work} \
|
||
|
${target}
|
||
|
else
|
||
|
@SBINPATH@/mount --bind "$lower" "$target"
|
||
|
fi
|
||
|
fi
|