1.1 --- a/tools/install.sh Mon Aug 31 23:29:43 2015 +0200
1.2 +++ b/tools/install.sh Tue Sep 01 15:59:42 2015 +0200
1.3 @@ -5,6 +5,7 @@
1.4 AGENTS="imip_person.py imip_person_outgoing.py imip_resource.py"
1.5 MODULES="markup.py imip_store.py vCalendar.py vContent.py vRecurrence.py"
1.6 INSTALL_DIR=/var/lib/imip-agent
1.7 +CONFIG_DIR=/etc/imip-agent
1.8
1.9 if [ ! -e "$INSTALL_DIR" ]; then
1.10 mkdir -p "$INSTALL_DIR"
1.11 @@ -20,14 +21,33 @@
1.12 fi
1.13 fi
1.14
1.15 -if [ -e "$INSTALL_DIR/imiptools/config.py" ]; then
1.16 - if [ ! -e "$INSTALL_DIR/imiptools/config.py.backup" ]; then
1.17 - mv "$INSTALL_DIR/imiptools/config.py" "$INSTALL_DIR/imiptools/config.py.backup"
1.18 +# Remove any symbolic link to the config module.
1.19 +
1.20 +if [ -h "$INSTALL_DIR/imiptools/config.py" ]; then
1.21 + rm "$INSTALL_DIR/imiptools/config.py"
1.22 +fi
1.23 +
1.24 +# Copy modules into the installation directory.
1.25 +
1.26 +cp imiptools/*.py "$INSTALL_DIR/imiptools/"
1.27 +cp imiptools/handlers/*.py "$INSTALL_DIR/imiptools/handlers/"
1.28 +
1.29 +# Install the config module in a more appropriate location.
1.30 +
1.31 +if [ ! -e "$CONFIG_DIR" ]; then
1.32 + mkdir -p "$CONFIG_DIR"
1.33 +fi
1.34 +
1.35 +if [ -e "$CONFIG_DIR/config.py" ]; then
1.36 + if [ ! -e "$CONFIG_DIR/config.py.backup" ]; then
1.37 + mv "$CONFIG_DIR/config.py" "$CONFIG_DIR/config.py.backup"
1.38 fi
1.39 fi
1.40
1.41 -cp imiptools/*.py "$INSTALL_DIR/imiptools/"
1.42 -cp imiptools/handlers/*.py "$INSTALL_DIR/imiptools/handlers/"
1.43 +# Replace the config module with a symbolic link.
1.44 +
1.45 +mv "$INSTALL_DIR/imiptools/config.py" "$CONFIG_DIR/"
1.46 +ln -s "$CONFIG_DIR/config.py" "$INSTALL_DIR/imiptools/config.py"
1.47
1.48 # Tools
1.49