-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·41 lines (33 loc) · 967 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -o pipefail
# path to config file that you wnat to use
PORTAL_ROOT="/opt/cantemo/portal"
CONFIG_FILE="$PORTAL_ROOT/portal_media/js/bccm-config.js"
PLUGIN_NAME="ManualRuleButtonPlugin"
if [ $(id -u) -ne 0 ]
then echo "Please run as root"
exit
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "X${DIR}" = "X" ]; then
echo "Error: Could not figure out your source directory. This should not happen."
exit 1
fi
mkdir -pv $PORTAL_ROOT/portal/plugins/$PLUGIN_NAME
cp -rv $DIR/* $PORTAL_ROOT/portal/plugins/$PLUGIN_NAME
cp -rv $DIR/js/* $PORTAL_ROOT/portal_media/js/
if [ -f "$CONFIG_FILE" ]; then
echo "$CONFIG_FILE exists."
else
echo "$CONFIG_FILE does not exist."
cp -v $DIR/js/bccm-example-config.js $CONFIG_FILE
fi
echo "Done."
echo "Stopping portal"
systemctl stop portal.target
echo "Syncing data"
cd "$PORTAL_ROOT"
python manage.py syncdata
cd $DIR
echo "Starting portal"
systemctl start portal.target