diff --git a/mount.sh b/mount.sh new file mode 100755 index 0000000..8d28b19 --- /dev/null +++ b/mount.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +bin_dir="$(cd "$(dirname "$0")" && pwd)" + +while read module +do + orig_path="${module#*;}" + link_path="$bin_dir/site-cookbooks/${module%;*}" + mkdir -p "$link_path" + [[ "$(ls -A "$link_path")" ]] && sudo umount "$link_path" + sudo mount --bind "$orig_path" "$link_path" +done < "$bin_dir/modules" diff --git a/unmount.sh b/unmount.sh new file mode 100755 index 0000000..5e1aadf --- /dev/null +++ b/unmount.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +bin_dir="$(cd "$(dirname "$0")" && pwd)" + +while read module +do + link_path="$bin_dir/site-cookbooks/${module%;*}" + mkdir -p "$link_path" + [[ "$(ls -A "$link_path")" ]] && sudo umount "$link_path" +done < "$bin_dir/modules"