-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathpost-install.sh
56 lines (49 loc) · 1.85 KB
/
post-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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# post-install script for Jeedom plugin teleinfo
#!/bin/bash
PROGRESS_FILE=/tmp/jeedom_install_in_progress_teleinfo
if [ ! -z $1 ]; then
PROGRESS_FILE=$1
fi
date
touch ${PROGRESS_FILE}
echo 0 > ${PROGRESS_FILE}
echo "**********************************"
echo "* Installation des dépendances *"
echo "**********************************"
BASEDIR=/var/www/html/plugins/teleinfo/ressources
echo 5 > ${PROGRESS_FILE}
sudo apt-get update
date
#echo 10 > ${PROGRESS_FILE}
#sudo apt remove -y python3-serial
echo 10 > ${PROGRESS_FILE}
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libxml2-dev libxslt-dev
echo 15 > ${PROGRESS_FILE}
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3
date
echo 20 > ${PROGRESS_FILE}
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-venv python3-pip python3-dev
date
echo 25 > ${PROGRESS_FILE}
sudo -u www-data python3 -m venv $BASEDIR/venv --without-pip --system-site-packages
date
sudo -u www-data $BASEDIR/venv/bin/python3 -m pip install --upgrade pip wheel
echo 30 > ${PROGRESS_FILE}
sudo -u www-data $BASEDIR/venv/bin/pip3 install --no-cache-dir pylibftdi
echo 35 > ${PROGRESS_FILE}
sudo -u www-data $BASEDIR/venv/bin/pip3 install --no-cache-dir six
echo 40 > ${PROGRESS_FILE}
sudo -u www-data $BASEDIR/venv/bin/pip3 install --no-cache-dir pyserial
echo 45 > ${PROGRESS_FILE}
sudo -u www-data $BASEDIR/venv/bin/pip3 install --no-cache-dir setuptools
echo 50 > ${PROGRESS_FILE}
sudo -u www-data $BASEDIR/venv/bin/pip3 install --no-cache-dir requests
echo 55 > ${PROGRESS_FILE}
sudo -u www-data $BASEDIR/venv/bin/pip3 install --no-cache-dir pyudev
echo 60 > ${PROGRESS_FILE}
sudo -u www-data $BASEDIR/venv/bin/pip3 install --no-cache-dir paho-mqtt==1.6.1
date
rm ${PROGRESS_FILE}
echo "*************************************"
echo "* Installation des dépendances OK *"
echo "*************************************"