2012-06-22 12:26:38 -04:00
|
|
|
#!/bin/bash
|
2012-06-08 12:54:03 +10:00
|
|
|
|
2012-06-22 12:26:38 -04:00
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
|
|
echo "This script must be run as root"
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-06-08 12:54:03 +10:00
|
|
|
|
2012-06-22 12:26:38 -04:00
|
|
|
CONF_DIR=/etc/heat
|
|
|
|
LOG_DIR=/var/log/heat
|
|
|
|
|
|
|
|
mkdir -p $LOG_DIR
|
|
|
|
mkdir -p $CONF_DIR
|
|
|
|
|
|
|
|
pushd etc > /dev/null
|
2012-06-08 12:54:03 +10:00
|
|
|
for f in *
|
|
|
|
do
|
2012-06-22 12:26:38 -04:00
|
|
|
if [ -d $f ]; then
|
|
|
|
# ignore directories
|
|
|
|
continue
|
|
|
|
elif [ -f $CONF_DIR/$f ]; then
|
|
|
|
echo "not copying over $CONF_DIR/$f"
|
|
|
|
diff -u $CONF_DIR/$f $f
|
2012-07-26 12:57:57 -07:00
|
|
|
elif [ $f = 'heat-engine.conf' ]; then
|
2012-07-27 14:37:17 +02:00
|
|
|
cat $f | sed s/%ENCRYPTION_KEY%/`hexdump -n 16 -v -e '/1 "%02x"' /dev/random`/ > $CONF_DIR/$f
|
2012-06-08 12:54:03 +10:00
|
|
|
else
|
2012-06-22 12:26:38 -04:00
|
|
|
cp $f $CONF_DIR
|
2012-06-08 12:54:03 +10:00
|
|
|
fi
|
|
|
|
done
|
2012-06-22 12:26:38 -04:00
|
|
|
popd > /dev/null
|
2012-06-08 12:54:03 +10:00
|
|
|
|
2012-06-25 18:04:25 -04:00
|
|
|
./setup.py install >/dev/null
|
2012-06-08 12:54:03 +10:00
|
|
|
rm -rf build heat.egg-info
|
|
|
|
|