Skip to content

Instantly share code, notes, and snippets.

@phunehehe
Created November 5, 2013 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phunehehe/7316281 to your computer and use it in GitHub Desktop.
Save phunehehe/7316281 to your computer and use it in GitHub Desktop.
Manage Chef modules
name;/path/to/name
#!/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"
#!/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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment