-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsetup.sh
executable file
·36 lines (30 loc) · 1004 Bytes
/
setup.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
#!/bin/bash
# Auto setup script for alarmmonitor
set -eo pipefail
if [[ -n "$TRACE" ]]; then
set -x
fi
GITHUB_USER=${GITHUB_USER:-"stg93"}
GITHUB_BRANCH=${GITHUB_BRANCH:-"master"}
GITHUB_REPO_NAME=${GITHUB_REPO_NAME:-"blaulichtsms_einsatzmonitor_tv_controller"}
GITHUB_DOWNLOAD_URL="https://github.com/${GITHUB_USER}/${GITHUB_REPO_NAME}/archive/${GITHUB_BRANCH}.zip"
GITHUB_REPO="https://github.com/${GITHUB_USER}/${GITHUB_REPO_NAME}.git"
echo
echo "Installing dependencies"
sudo apt update && sudo apt -y install git cec-utils
sudo pip3 install --system "requests" "cec" "pyyaml"
echo
echo "cloning alarmmonitor from Github"
git clone -b "${GITHUB_BRANCH}" "${GITHUB_REPO}"
cd "${GITHUB_REPO_NAME}"
echo "Configuring alarmmonitor"
if [[ -f "../config.ini" ]]; then
echo "Using predefined config"
cp ../config.ini ./
echo "Setting service user to ${USER}"
sed -i "s|User=.*|User=${USER}|g" alarmmonitor.service
else
python3 configure.py
fi
echo "Installing alarmmonitor"
sudo ./INSTALL