-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·47 lines (37 loc) · 1.22 KB
/
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
#!/bin/bash
echo "Libellule Installation"
dir_install="/var/www/libellule/"
echo "Check prerequisites"
#echo import sys; print(sys.version)" | python | head -n1 | awk '{print $1}'
#echo sqlite -v
sudo apt-get -y install sqlite3 php5-sqlite
echo "Configuration"
echo "Directory Installation for Libellule (default : /var/www/libellule/) ?"
read dir_install_tmp
if [ ! -z "$dir_install_tmp" ]; then
dir_install=${dir_install_tmp}"/"
fi
echo "Installation"
echo "Directory Installation : ${dir_install}"
if [ -d ${dir_install} ]; then
echo "Directory ${dir_install_web} already exists"
else
echo "Directory Creation"
sudo mkdir -p ${dir_install}
fi
echo "Copy of content"
sudo cp -R web/* ${dir_install}/
sudo cp -R test ${dir_install}
sudo wget -O ${dir_install}/test/speedtest-cli.py https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
echo "Rights Management"
sudo chown -R www-data. ${dir_install}
sudo chmod +x ${dir_install}/test/speedtest-cli.py
echo "Cron installation"
sudo crontab -l > cron_backup
cp cron_backup new_cron
#echo new cron into cron file
echo "00 03 * * * /var/www/libellule/test/libellule.sh" >> new_cron
#install new cron file
sudo crontab new_cron
rm new_cron
echo "Installation finished, enjoy :)"