forked from nreca-bts/omf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudDeploy.sh
More file actions
executable file
·27 lines (27 loc) · 928 Bytes
/
cloudDeploy.sh
File metadata and controls
executable file
·27 lines (27 loc) · 928 Bytes
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
# Update this OMF install to the latest from the source tree.
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
else
echo "** Stopping the service."
systemctl stop omf
# Local backup disabled since we use a more durable AWS backup now.
# echo "** Backing up data folder."
# tar -czf ~/dataBackup.tgz /omf/omf/data
echo "** Backing up credentials."
cp /omf/omf/data/User/admin.json ~/admin.json
cp /omf/omf/emailCredentials.key ~/emailCredentials.key
echo "** Pulling the latest source from git."
git reset --hard
git pull
echo "** Restoring our admin user and keys."
cp ~/admin.json /omf/omf/data/User/admin.json
cp ~/emailCredentials.key /omf/omf/emailCredentials.key
echo "** Setting permissions."
chown -R root *
chgrp -R root *
echo "** Re-run install to handle any missing requirements."
python /omf/install.py
echo "** Restarting the service."
systemctl start omf
fi