-
Notifications
You must be signed in to change notification settings - Fork 14
/
install
36 lines (30 loc) · 1.04 KB
/
install
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/sh
if [ $(whoami) != 'root' ]; then
echo -e "\nVous devez avoir les droits super-utilisateur pour executer $0"
exit 1;
fi
# Check Python 3 is installed
if [[ ! $(which python3) ]]; then
echo "Python 3 is required"
exit 1
fi
echo "Installation des dépendances"
apt-get update
apt-get install build-essential \
libsystemd-dev \
python-systemd
/usr/bin/python3 -m pip install paho-mqtt
/usr/bin/python3 -m pip install websocket-client
/usr/bin/python3 -m pip install systemd-python
/usr/bin/python3 -m pip install psutil
echo "Copie des fichiers necessaires"
if [ ! -d "/usr/local/lib/maestro_service/" ];then
mkdir /usr/local/lib/maestro_service/
chown -R maestro_service /usr/local/lib/maestro_service/
chmod -R 0755 /usr/local/lib/maestro_service/
fi
cp _config_.py /usr/local/lib/maestro_service
cp commands.py /usr/local/lib/maestro_service
cp messages.py /usr/local/lib/maestro_service
cp maestro.py /usr/local/lib/maestro_service
python3 /usr/local/lib/maestro_service/maestro.py