Files
streamline-emr/install.sh
T
alec.turner a2a9395e39 Make image packaging and installation optional
Eventually, images should not be transferred as part of the application package,
using a more efficient mechanism instead. Other cases may already exist where
packaging without the image is preferrable.

When the `PACKAGE_IMAGES` variable is not set to 1 (default: 1), images will not
be included in the package. The installation script now handles the case where
the `images` folder is missing altogether.
2024-03-08 12:29:40 -08:00

52 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (C) Wendepunkt Medical Innovations, Inc - All Rights Reserved.
# Unauthorized copying of this file, via any medium is strictly prohibited.
# Proprietary and confidential
#
# For information: dev@signalytic.ca
#
#
# Install the Streamline "Streamline EMR" application and services
#
# The caller of this script must check the exit value and possibly do a
# roll-back if it is non-zero. If the exit value is non-zero services have not
# been restarted.
LOCATION="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
fi
# stop any running systemd service if not running in a docker environment
if [ -f /.dockerenv ]; then
echo "Docker environment detected - skipping systemd installation"
else
echo "stopping system service"
systemctl stop streamline-emr
fi
set -e
# copy root files
echo "importing root files"
cp -rfv $LOCATION/root/* /
# import docker images
for f in $(find $LOCATION/images -name "*.img" 2>/dev/null);do
echo "importing docker image: $f"
docker load -i $f
done
# install systemd service unless running in a docker environment
if [ ! -f /.dockerenv ]; then
echo "installing system service"
systemctl daemon-reload
systemctl enable streamline-emr
systemctl start streamline-emr
fi