heat/install.sh
Tomas Sedovic b6d2608dd2 Don't use uuidgen in install.sh
uuidgen is not present in Ubuntu. This simply reads 16 bytes from
/dev/random and stores their hex representation.

Change-Id: If1152242b024218f20bd4c787e03836f0d5f49cf
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-07-27 14:37:17 +02:00

34 lines
654 B
Bash
Executable File

#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
CONF_DIR=/etc/heat
LOG_DIR=/var/log/heat
mkdir -p $LOG_DIR
mkdir -p $CONF_DIR
pushd etc > /dev/null
for f in *
do
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
elif [ $f = 'heat-engine.conf' ]; then
cat $f | sed s/%ENCRYPTION_KEY%/`hexdump -n 16 -v -e '/1 "%02x"' /dev/random`/ > $CONF_DIR/$f
else
cp $f $CONF_DIR
fi
done
popd > /dev/null
./setup.py install >/dev/null
rm -rf build heat.egg-info