Skip to content

Commit

Permalink
add utility scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
phunehehe committed Jun 16, 2014
1 parent e38c5ed commit 299d1eb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mount.sh
Original file line number Diff line number Diff line change
@@ -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"
12 changes: 12 additions & 0 deletions unmount.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 299d1eb

Please sign in to comment.