Skip to content

Instantly share code, notes, and snippets.

@wikitopian
Created September 3, 2016 16:51
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 wikitopian/28cf92f407b6a839acfc04ff95a371ed to your computer and use it in GitHub Desktop.
Save wikitopian/28cf92f407b6a839acfc04ff95a371ed to your computer and use it in GitHub Desktop.
#!/bin/bash
find $1 -type f | sed -e "s#$1\(.*\)#rm -f \\1#g" | bash
find $1 -type f | sed -e "s#$1\(.*\)\/\(.*\)#mkdir -p \\1#g" | bash
find $1 -type f | sed -e "s#$1\(.*\)#ln -s $PWD\/fs\1 \1#g" | bash
@wikitopian
Copy link
Author

Summary

Rapidly configure a system by crafting a shadow root directory of all the configuration files, then automatically crawl through it and replace the original configuration files with symbolic links.

Usage

The argument is the path of the shadow root. In this case, it's fs/.

sudo ./sym-copy.sh fs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment