-dir=/q/root/shadow
-fai_shadow=$FAI/distro-install-common/shadow
-if [[ ! -e $dir && -e $fai_shadow ]]; then
- mkdir -p $dir
- mount -o bind $fai_shadow $dir
-fi
-$FAI/distro-install-common/end
+bind-common() {
+ src=$1
+ dst=$2
+ if [[ ! -e $dst && -e $src ]]; then
+ mkdir -p $dst
+ mount -o bind $src $dst
+ fi
+
+}
+bind-common $FAI/distro-install-common/shadow /q/root/shadow