Created
August 9, 2014 15:23
-
-
Save voronkovich/22bd9d2cd5461f255531 to your computer and use it in GitHub Desktop.
Moving MODx to another directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# | |
# Launch this script in a new MODx directory | |
# | |
old_path=$(sed -ne "s/^.*\\\$modx_base_path[[:space:]]*=[[:space:]]*'\\(.*\\)';.*$/\\1/p" core/config/config.inc.php) | |
new_path=$(readlink -f ${2:="."} 2&>/dev/null) | |
for file in $(grep -lR --exclude-dir="cache" $old_path * 2&> /dev/null) | |
do | |
sed -nie "s/$old_path/$new_path\/" $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment