Changeset View
Changeset View
Standalone View
Standalone View
bin/configure.sh
- This file was added.
Property | Old Value | New Value |
---|---|---|
File Mode | null | 100755 |
#!/bin/bash | |||||
if [ ! -d $1 ]; then | |||||
echo "Failed to find the configuration folder, please pass one as argument (e.g. config.local)." | |||||
exit 1 | |||||
fi | |||||
# Uninstall the old config | |||||
if [ -d config ]; then | |||||
find config/ -type f | while read file; do | |||||
file=$(echo $file | sed -e 's|^config||g') | |||||
file="./$file" | |||||
rm -v $file | |||||
done | |||||
fi | |||||
# Link new config | |||||
rm config | |||||
ln -s $1 config | |||||
# Install new config | |||||
find config/ -type f | while read file; do | |||||
dir=$(dirname $file | sed -e 's|^config||g') | |||||
dir="./$dir" | |||||
if [ ! -d $dir ]; then | |||||
mkdir -p $dir | |||||
fi | |||||
cp -av $file $dir/ | |||||
done |