mirror of
https://github.com/thingsboard/thingsboard-gateway
synced 2025-10-26 22:31:42 +08:00
49 lines
2.2 KiB
Bash
Executable File
49 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# Copyright 2021. ThingsBoard
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
set -e
|
|
|
|
# Automatically added by dh_python3:
|
|
if which py3compile >/dev/null 2>&1; then
|
|
py3compile -p python3-thingsboard-gateway
|
|
fi
|
|
if which pypy3compile >/dev/null 2>&1; then
|
|
pypy3compile -p python3-thingsboard-gateway || true
|
|
fi
|
|
|
|
# End automatically added section
|
|
echo "Installing jsonschema"
|
|
sudo rm -rf /usr/lib/python3/dist-packages/jsonschema
|
|
CURRENT_USER=$USER
|
|
sudo pip3 install --upgrade jsonschema==3.1.1
|
|
#sudo pip3 install --upgrade bluepy
|
|
sudo pip3 install --upgrade pyrsistent --progress-bar off -qqq || echo "OK"
|
|
sudo pip3 install --upgrade importlib --progress-bar off -qqq || echo "OK"
|
|
sudo pip3 install --upgrade importlib-metadata --progress-bar off -qqq || echo "OK"
|
|
sudo cp -a -r /etc/thingsboard-gateway/extensions /var/lib/thingsboard_gateway/
|
|
sudo rm -r /etc/thingsboard-gateway/extensions
|
|
sudo usermod -a -G dialout $CURRENT_USER
|
|
sudo usermod -a -G thingsboard_gateway $CURRENT_USER
|
|
sudo chown thingsboard_gateway:thingsboard_gateway /var/log/thingsboard-gateway/ -R
|
|
sudo chown thingsboard_gateway:thingsboard_gateway /var/lib/thingsboard_gateway/ -R
|
|
sudo chown thingsboard_gateway:thingsboard_gateway /etc/thingsboard-gateway/ -R
|
|
sudo sed -i 's/\.\/logs/\/var\/log\/thingsboard-gateway/g' /etc/thingsboard-gateway/config/logs.conf >> /etc/thingsboard-gateway/config/logs.conf
|
|
echo "Installation completed"
|
|
echo "Enabling daemon..."
|
|
sudo pidof systemd && sudo systemctl enable thingsboard-gateway || echo "Systemctl not found"
|
|
#echo "Daemon starting..."
|
|
sudo pidof systemd && sudo systemctl start thingsboard-gateway || echo
|
|
echo -e "\e[96mThingsboard Gateway \e[92mhas been installed. Have a nice day \e[93m\e[5m:)\e[25m\e[39m"
|